Programmer Reference : Asynchronous Programming : EsAsyncUncaughtErrorHandler
EsAsyncUncaughtErrorHandler
Description
Handler for all uncaught async errors. By default, uncaught errors will be logged to the tty console.
If the user want to disable uncaught error behavior, they can use send enabled: false to the default handler
EsAsyncUncaughtErrorHandler default enabled: false
Users can also set the errorBlock which the action performed for each error that arrives. This gives the user complete
control to do something other than the default
EsAsyncUncaughtErrorHandler default errorBlock: [:error :stackTrace | self logToFile: stackTrace].
Instance State
listener: <EsFutureListener> holds onto and evals error block
enabled: <Boolean> true to enable catching errors, false to ignore
Class Methods
default
  Answer the default error handler

     Answers:
        <EsAsyncUncaughtErrorHandler>
default:
  Set the default error handler which handles uncaught
     async errors

     Arguments:
        anErrorHandler - <EsAsyncUncaughtErrorHandler>
new
  Answer a new uncaught error handler instance.

     Answers:
        <EsAsyncUncaughtErrorHandler>
Instance Methods
enabled
  Answer true if the error handler should be enabled,
     false to ignore errors

     Answers:
        <Boolean>
enabled:
  Set true if the error handler should be enabled,
     false to ignore errors

     Answers:
        <Boolean>
errorBlock
  Answer the error block that is evaluated when errors
     are to be handled.  The listener is the one that holds onto this

     Answers:   
        <Block> 2-arg culled block with <Object> error and <EsAsyncStackTrace> stack trace
errorBlock:
  Set the error block that is evaluated when errors
     are to be handled.  This will create a new listener
     with the provided error block

     Arguments: 
        anErrorBlock - <Block> 2-arg culled block with <Object> error and <EsAsyncStackTrace> stack trace
handleError:
  Handles uncaught asynchronous errors.
     By default, this means logging the error to
     the TTY console

     Futures:
     If a future does not have a successor when it completes with
     an error, it forwards the error message here.

     Arguments:
        anAsyncError - <EsAsyncError>
Last modified date: 04/21/2022