# ErrorManager

public class **ErrorManager** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
ErrorManager objects can be attached to Handlers to process
any error that occurs on a Handler during Logging.


When processing logging output, if a Handler encounters problems
then rather than throwing an Exception back to the issuer of
the logging call (who is unlikely to be interested) the Handler
should call its associated ErrorManager.

### Constant Summary

|---|---|---|
| int | [CLOSE_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#CLOSE_FAILURE) | CLOSE_FAILURE is used when a close of an output stream fails. |
| int | [FLUSH_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#FLUSH_FAILURE) | FLUSH_FAILURE is used when a flush to an output stream fails. |
| int | [FORMAT_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#FORMAT_FAILURE) | FORMAT_FAILURE is used when formatting fails for any reason. |
| int | [GENERIC_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#GENERIC_FAILURE) | GENERIC_FAILURE is used for failure that don't fit into one of the other categories. |
| int | [OPEN_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#OPEN_FAILURE) | OPEN_FAILURE is used when an open of an output stream fails. |
| int | [WRITE_FAILURE](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#WRITE_FAILURE) | WRITE_FAILURE is used when a write to an output stream fails. |

### Public Constructor Summary

|---|---|
|   | [ErrorManager](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#ErrorManager())() |

### Public Method Summary

|---|---|
| synchronized void | [error](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/ErrorManager.html#error(java.lang.String,%20java.lang.Exception,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) msg, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) ex, int code) The error method is called when a Handler failure occurs. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Constants

#### public static final int
**CLOSE_FAILURE**

CLOSE_FAILURE is used when a close of an output stream fails.
Constant Value: 3

#### public static final int
**FLUSH_FAILURE**

FLUSH_FAILURE is used when a flush to an output stream fails.
Constant Value: 2

#### public static final int
**FORMAT_FAILURE**

FORMAT_FAILURE is used when formatting fails for any reason.
Constant Value: 5

#### public static final int
**GENERIC_FAILURE**

GENERIC_FAILURE is used for failure that don't fit
into one of the other categories.
Constant Value: 0

#### public static final int
**OPEN_FAILURE**

OPEN_FAILURE is used when an open of an output stream fails.
Constant Value: 4

#### public static final int
**WRITE_FAILURE**

WRITE_FAILURE is used when a write to an output stream fails.
Constant Value: 1

## Public Constructors

#### public
**ErrorManager**
()

<br />

## Public Methods

#### public synchronized void
**error**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) msg, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) ex, int code)

The error method is called when a Handler failure occurs.


This method may be overridden in subclasses. The default
behavior in this base class is that the first call is
reported to System.err, and subsequent calls are ignored.

##### Parameters

| msg | a descriptive string (may be null) |
| ex | an exception (may be null) |
| code | an error code defined in ErrorManager |
|---|---|