Error Handling Fundamentals

Learn how to implement error handling in Sanbox

There are two Nodes that facilitate error handling directly - the Error Handler Node and the Throw Error Node.

Error Handling

The Error Handler Node can be configured to handle errors that happen anywhere in a Workflow, or configured to only handle errors for a certain group.

Configuring an Error Handler Node

In addition, Error Handler Nodes can be configured to handle only a certain exception type. Exception types can be the internal exception types to .Net Core, or exception types you specify with the Throw Error Node.

By default, Error Handler Nodes outputs an object regarding information on which node threw the error, the input, and other useful information. You can check 'Output only message' to output just the error message. Check out the Model Viewer to see the difference.

Using The Error Handler Node

The Error Handler Node is special because it doesn't participate in normal input/output execution flow. When an error occurs in the Workflow, the Workflow's execution path moves to an applicable Error Handler Node.

Error Handler Node For Handling Invalid Authentication

Uncaught Errors

If an error occurs in your Workflow and there is no Error Handler Node to catch it, it will bubble up to the Runtime. The Runtime will log the error, and do the following, depending on the type of Workflow.

Workflow Type

Uncaught Error Handling Behavior

API/Web

If the ASPNETCORE_ENVIRONMENT environment variable for the System running the Runtime is set to Production then a generic server error with a status code of 500 is returned to the consumer. Otherwise, complete error details are sent in JSON format.

Function

The Function Caller Node that is calling the function will throw an error.

Job

Execution of Job stops and is attempted again next time its scheduled.

Error Throwing

Any Node can throw an error, but you can use the Throw Error Node to explicitly throw an error. Like the Handle Error Node, the Throw Error Node is special because it doesn't participate in normal input/output execution flow.

Throw Error Node In Use

A Throw Error Node can be configured to throw an error of a specified type, which in this case coincides with the type handled in our above error handling example.

Configuring a Throw Error Node