Stay organized with collections
Save and categorize content based on your preferences.
ErrorManager
open class ErrorManager
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 |
static Int |
CLOSE_FAILURE is used when a close of an output stream fails.
|
static Int |
FLUSH_FAILURE is used when a flush to an output stream fails.
|
static Int |
FORMAT_FAILURE is used when formatting fails for any reason.
|
static Int |
GENERIC_FAILURE is used for failure that don't fit into one of the other categories.
|
static Int |
OPEN_FAILURE is used when an open of an output stream fails.
|
static Int |
WRITE_FAILURE is used when a write to an output stream fails.
|
Public methods |
open Unit |
The error method is called when a Handler failure occurs.
|
Constants
CLOSE_FAILURE
static val CLOSE_FAILURE: Int
CLOSE_FAILURE is used when a close of an output stream fails.
Value: 3
FLUSH_FAILURE
static val FLUSH_FAILURE: Int
FLUSH_FAILURE is used when a flush to an output stream fails.
Value: 2
static val FORMAT_FAILURE: Int
FORMAT_FAILURE is used when formatting fails for any reason.
Value: 5
GENERIC_FAILURE
static val GENERIC_FAILURE: Int
GENERIC_FAILURE is used for failure that don't fit into one of the other categories.
Value: 0
OPEN_FAILURE
static val OPEN_FAILURE: Int
OPEN_FAILURE is used when an open of an output stream fails.
Value: 4
WRITE_FAILURE
static val WRITE_FAILURE: Int
WRITE_FAILURE is used when a write to an output stream fails.
Value: 1
Public constructors
ErrorManager
ErrorManager()
Public methods
error
open fun error(
msg: String!,
ex: Exception!,
code: Int
): Unit
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ErrorManager\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nErrorManager\n============\n\n```\nopen class ErrorManager\n```\n\n|---|-------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.util.logging.ErrorManager](#) |\n\nErrorManager objects can be attached to Handlers to process any error that occurs on a Handler during Logging.\n\nWhen 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.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CLOSE_FAILURE](#CLOSE_FAILURE:kotlin.Int) CLOSE_FAILURE is used when a close of an output stream fails. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FLUSH_FAILURE](#FLUSH_FAILURE:kotlin.Int) FLUSH_FAILURE is used when a flush to an output stream fails. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FORMAT_FAILURE](#FORMAT_FAILURE:kotlin.Int) FORMAT_FAILURE is used when formatting fails for any reason. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [GENERIC_FAILURE](#GENERIC_FAILURE:kotlin.Int) GENERIC_FAILURE is used for failure that don't fit into one of the other categories. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [OPEN_FAILURE](#OPEN_FAILURE:kotlin.Int) OPEN_FAILURE is used when an open of an output stream fails. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [WRITE_FAILURE](#WRITE_FAILURE:kotlin.Int) WRITE_FAILURE is used when a write to an output stream fails. |\n\n| Public constructors ||\n|--------------------------------------------|---|\n| [ErrorManager](#ErrorManager())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [error](#error(kotlin.String,%20java.lang.Exception,%20kotlin.Int))`(`msg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `ex:` `[Exception](../../lang/Exception.html#)!`, `code:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` The error method is called when a Handler failure occurs. |\n\nConstants\n---------\n\n### CLOSE_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CLOSE_FAILURE: Int\n```\n\nCLOSE_FAILURE is used when a close of an output stream fails. \n\n Value: 3\n\n### FLUSH_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FLUSH_FAILURE: Int\n```\n\nFLUSH_FAILURE is used when a flush to an output stream fails. \n\n Value: 2\n\n### FORMAT_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FORMAT_FAILURE: Int\n```\n\nFORMAT_FAILURE is used when formatting fails for any reason. \n\n Value: 5\n\n### GENERIC_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val GENERIC_FAILURE: Int\n```\n\nGENERIC_FAILURE is used for failure that don't fit into one of the other categories. \n\n Value: 0\n\n### OPEN_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val OPEN_FAILURE: Int\n```\n\nOPEN_FAILURE is used when an open of an output stream fails. \n\n Value: 4\n\n### WRITE_FAILURE\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val WRITE_FAILURE: Int\n```\n\nWRITE_FAILURE is used when a write to an output stream fails. \n\n Value: 1\n\nPublic constructors\n-------------------\n\n### ErrorManager\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nErrorManager()\n```\n\nPublic methods\n--------------\n\n### error\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun error(\n msg: String!, \n ex: Exception!, \n code: Int\n): Unit\n```\n\nThe error method is called when a Handler failure occurs.\n\nThis 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.\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------|\n| `msg` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: a descriptive string (may be null) |\n| `ex` | [Exception](../../lang/Exception.html#)!: an exception (may be null) |\n| `code` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): an error code defined in ErrorManager |"]]