# Class ErrorManager

java.lang.Object
java.util.logging.ErrorManager

public class ErrorManager extends Object
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.

Since:
  1.4

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CLOSE_FAILURE`
  CLOSE_FAILURE is used when a close of an output stream fails.
  `static final int`
  `FLUSH_FAILURE`
  FLUSH_FAILURE is used when a flush to an output stream fails.
  `static final int`
  `FORMAT_FAILURE`
  FORMAT_FAILURE is used when formatting fails for any reason.
  `static final int`
  `GENERIC_FAILURE`
  GENERIC_FAILURE is used for failure that don't fit into one of the other categories.
  `static final int`
  `OPEN_FAILURE`
  OPEN_FAILURE is used when an open of an output stream fails.
  `static final int`
  `WRITE_FAILURE`
  WRITE_FAILURE is used when a write to an output stream fails.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ErrorManager()`
  Create an `ErrorManager`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `error(String msg, Exception ex, int code)`
  The error method is called when a Handler failure occurs.

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `int`
  `hashCode()`
  Returns a hash code value for this object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(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(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.

- ## Field Details

  - ### GENERIC_FAILURE

    public static final int GENERIC_FAILURE
    GENERIC_FAILURE is used for failure that don't fit into one of the other categories.
    See Also:
      - Constant Field Values

  - ### WRITE_FAILURE

    public static final int WRITE_FAILURE
    WRITE_FAILURE is used when a write to an output stream fails.
    See Also:
      - Constant Field Values

  - ### FLUSH_FAILURE

    public static final int FLUSH_FAILURE
    FLUSH_FAILURE is used when a flush to an output stream fails.
    See Also:
      - Constant Field Values

  - ### CLOSE_FAILURE

    public static final int CLOSE_FAILURE
    CLOSE_FAILURE is used when a close of an output stream fails.
    See Also:
      - Constant Field Values

  - ### OPEN_FAILURE

    public static final int OPEN_FAILURE
    OPEN_FAILURE is used when an open of an output stream fails.
    See Also:
      - Constant Field Values

  - ### FORMAT_FAILURE

    public static final int FORMAT_FAILURE
    FORMAT_FAILURE is used when formatting fails for any reason.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ErrorManager

    public ErrorManager()
    Create an `ErrorManager`.

- ## Method Details

  - ### error

    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.

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