Stay organized with collections
Save and categorize content based on your preferences.
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.
Summary
Constants |
int |
CLOSE_FAILURE
CLOSE_FAILURE is used when a close of an output stream fails.
|
int |
FLUSH_FAILURE
FLUSH_FAILURE is used when a flush to an output stream fails.
|
int |
FORMAT_FAILURE
FORMAT_FAILURE is used when formatting fails for any reason.
|
int |
GENERIC_FAILURE
GENERIC_FAILURE is used for failure that don't fit
into one of the other categories.
|
int |
OPEN_FAILURE
OPEN_FAILURE is used when an open of an output stream fails.
|
int |
WRITE_FAILURE
WRITE_FAILURE is used when a write to an output stream fails.
|
Public methods |
void
|
error(String msg, Exception ex, int code)
The error method is called when a Handler failure occurs.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the 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(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(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()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
CLOSE_FAILURE
public static final int CLOSE_FAILURE
CLOSE_FAILURE is used when a close of an output stream fails.
Constant Value:
3
(0x00000003)
FLUSH_FAILURE
public static final int FLUSH_FAILURE
FLUSH_FAILURE is used when a flush to an output stream fails.
Constant Value:
2
(0x00000002)
public static final int FORMAT_FAILURE
FORMAT_FAILURE is used when formatting fails for any reason.
Constant Value:
5
(0x00000005)
GENERIC_FAILURE
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
(0x00000000)
OPEN_FAILURE
public static final int OPEN_FAILURE
OPEN_FAILURE is used when an open of an output stream fails.
Constant Value:
4
(0x00000004)
WRITE_FAILURE
public static final int WRITE_FAILURE
WRITE_FAILURE is used when a write to an output stream fails.
Constant Value:
1
(0x00000001)
Public constructors
ErrorManager
public ErrorManager ()
Public methods
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 |
String : a descriptive string (may be null) |
ex |
Exception : an exception (may be null) |
code |
int : an error code defined in ErrorManager |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ErrorManager\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nErrorManager\n============\n\n\n`\npublic\n\n\nclass\nErrorManager\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|--------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | java.util.logging.ErrorManager |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nErrorManager objects can be attached to Handlers to process\nany error that occurs on a Handler during Logging.\n\n\nWhen processing logging output, if a Handler encounters problems\nthen rather than throwing an Exception back to the issuer of\nthe logging call (who is unlikely to be interested) the Handler\nshould call its associated ErrorManager.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [CLOSE_FAILURE](/reference/java/util/logging/ErrorManager#CLOSE_FAILURE) CLOSE_FAILURE is used when a close of an output stream fails. |\n| `int` | [FLUSH_FAILURE](/reference/java/util/logging/ErrorManager#FLUSH_FAILURE) FLUSH_FAILURE is used when a flush to an output stream fails. |\n| `int` | [FORMAT_FAILURE](/reference/java/util/logging/ErrorManager#FORMAT_FAILURE) FORMAT_FAILURE is used when formatting fails for any reason. |\n| `int` | [GENERIC_FAILURE](/reference/java/util/logging/ErrorManager#GENERIC_FAILURE) GENERIC_FAILURE is used for failure that don't fit into one of the other categories. |\n| `int` | [OPEN_FAILURE](/reference/java/util/logging/ErrorManager#OPEN_FAILURE) OPEN_FAILURE is used when an open of an output stream fails. |\n| `int` | [WRITE_FAILURE](/reference/java/util/logging/ErrorManager#WRITE_FAILURE) WRITE_FAILURE is used when a write to an output stream fails. |\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------|---|\n| ` `[ErrorManager](/reference/java/util/logging/ErrorManager#ErrorManager())`() ` |\n\n| ### Public methods ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[error](/reference/java/util/logging/ErrorManager#error(java.lang.String,%20java.lang.Exception,%20int))`(`[String](/reference/java/lang/String)` msg, `[Exception](/reference/java/lang/Exception)` ex, int code) ` The error method is called when a Handler failure occurs. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/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](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/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](/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](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### CLOSE_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int CLOSE_FAILURE\n```\n\nCLOSE_FAILURE is used when a close of an output stream fails.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### FLUSH_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int FLUSH_FAILURE\n```\n\nFLUSH_FAILURE is used when a flush to an output stream fails.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### FORMAT_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int FORMAT_FAILURE\n```\n\nFORMAT_FAILURE is used when formatting fails for any reason.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n5\n(0x00000005)\n\n\n### GENERIC_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int GENERIC_FAILURE\n```\n\nGENERIC_FAILURE is used for failure that don't fit\ninto one of the other categories.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### OPEN_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int OPEN_FAILURE\n```\n\nOPEN_FAILURE is used when an open of an output stream fails.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n4\n(0x00000004)\n\n\n### WRITE_FAILURE\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int WRITE_FAILURE\n```\n\nWRITE_FAILURE is used when a write to an output stream fails.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic constructors\n-------------------\n\n### ErrorManager\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ErrorManager ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### error\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void error (String msg, \n Exception ex, \n int code)\n```\n\nThe error method is called when a Handler failure occurs.\n\n\nThis method may be overridden in subclasses. The default\nbehavior in this base class is that the first call is\nreported to System.err, and subsequent calls are ignored.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|-----------------------------------------------------|\n| `msg` | `String`: a descriptive string (may be null) \u003cbr /\u003e |\n| `ex` | `Exception`: an exception (may be null) \u003cbr /\u003e |\n| `code` | `int`: an error code defined in ErrorManager \u003cbr /\u003e |"]]