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
<details> default
<pre><code> Answer the default error handler
Answers:
<EsAsyncUncaughtErrorHandler>
</code></pre> </details>
<details> default:
<pre><code> Set the default error handler which handles uncaught async errors
Arguments:
anErrorHandler - <EsAsyncUncaughtErrorHandler>
</code></pre> </details>
<details> new
<pre><code> Answer a new uncaught error handler instance.
Answers:
<EsAsyncUncaughtErrorHandler>
</code></pre> </details>
Instance Methods
<details> enabled
<pre><code> Answer true if the error handler should be enabled, false to ignore errors
Answers:
<Boolean>
</code></pre> </details>
<details> enabled:
<pre><code> Set true if the error handler should be enabled, false to ignore errors
Answers:
<Boolean>
</code></pre> </details>
<details> errorBlock
<pre><code> 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
</code></pre> </details>
<details> errorBlock:
<pre><code> 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
</code></pre> </details>
<details> handleError:
<pre><code> 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>
</code></pre> </details>
Last modified date: 04/21/2022