public class ErrorManager extends Object
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.
| Modifier and Type | Field and Description | 
|---|---|
| static int | CLOSE_FAILURECLOSE_FAILURE is used when a close of an output stream fails. | 
| static int | FLUSH_FAILUREFLUSH_FAILURE is used when a flush to an output stream fails. | 
| static int | FORMAT_FAILUREFORMAT_FAILURE is used when formatting fails for any reason. | 
| static int | GENERIC_FAILUREGENERIC_FAILURE is used for failure that don't fit
 into one of the other categories. | 
| static int | OPEN_FAILUREOPEN_FAILURE is used when an open of an output stream fails. | 
| static int | WRITE_FAILUREWRITE_FAILURE is used when a write to an output stream fails. | 
| Constructor and Description | 
|---|
| ErrorManager() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | error(String msg,
     Exception ex,
     int code)The error method is called when a Handler failure occurs. | 
public static final int GENERIC_FAILURE
public static final int WRITE_FAILURE
public static final int FLUSH_FAILURE
public static final int CLOSE_FAILURE
public static final int OPEN_FAILURE
public static final int FORMAT_FAILURE
public void error(String msg, Exception ex, int code)
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.
msg - a descriptive string (may be null)ex - an exception (may be null)code - an error code defined in ErrorManager Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.