A mapping of error types to [[CatchBlocks]] intended to handle them.
Adds a catch block for a specific error type.
the type of error handled by the catch block
the function to be executed as the catch block
Executes a fully initialized Runner. Any errors thrown that don't have a matching CatchBlock will automatically be re-thrown.
Sets the finally block.
the function to be executed as the finally block
Sets the try block.
the function to be executed as the try block
The function to be executed as the finally block.
The function to be executed as the try block.
Generated using TypeDoc
Orchestrates the execution of a try/catch/finally sequence.
const runner = new Runner() runner.Try(() => { // Do something... }) .Catch(Exception, e => { // Handle any expected errors. }) .Finally(() => { // Optionally do something regardless of what happens. }) .Done()