# ErrorManager

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/java/util/logging/ErrorManager#constants)\|[Ctors](https://developer.android.com/reference/java/util/logging/ErrorManager#pubctors)\|[Methods](https://developer.android.com/reference/java/util/logging/ErrorManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/java/util/logging/ErrorManager#inhmethods)  

# ErrorManager

`
public


class
ErrorManager
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.util.logging.ErrorManager |

<br />

*** ** * ** ***

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.

## Summary

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

|                                             ### Public constructors                                              ||
|---------------------------------------------------------------------------------------------------------------|---|
| ` `[ErrorManager](https://developer.android.com/reference/java/util/logging/ErrorManager#ErrorManager())`() ` |

|                                                                                                                                                                                ### Public methods                                                                                                                                                                                 ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[error](https://developer.android.com/reference/java/util/logging/ErrorManager#error(java.lang.String,%20java.lang.Exception,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` msg, `[Exception](https://developer.android.com/reference/java/lang/Exception)` ex, int code) ` The error method is called when a Handler failure occurs. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### CLOSE_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CLOSE_FAILURE
```

CLOSE_FAILURE is used when a close of an output stream fails.

<br />

Constant Value: 3 (0x00000003)  

### FLUSH_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLUSH_FAILURE
```

FLUSH_FAILURE is used when a flush to an output stream fails.

<br />

Constant Value: 2 (0x00000002)  

### FORMAT_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FORMAT_FAILURE
```

FORMAT_FAILURE is used when formatting fails for any reason.

<br />

Constant Value: 5 (0x00000005)  

### GENERIC_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int GENERIC_FAILURE
```

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

<br />

Constant Value: 0 (0x00000000)  

### OPEN_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int OPEN_FAILURE
```

OPEN_FAILURE is used when an open of an output stream fails.

<br />

Constant Value: 4 (0x00000004)  

### WRITE_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int WRITE_FAILURE
```

WRITE_FAILURE is used when a write to an output stream fails.

<br />

Constant Value: 1 (0x00000001)

## Public constructors

### ErrorManager

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ErrorManager ()
```

<br />

<br />

## Public methods

### error

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void error (String msg, 
                Exception 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.

<br />

|                         Parameters                          ||
|--------|-----------------------------------------------------|
| `msg`  | `String`: a descriptive string (may be null) <br /> |
| `ex`   | `Exception`: an exception (may be null) <br />      |
| `code` | `int`: an error code defined in ErrorManager <br /> |