Sometimes, it can be necessary to force a process to stop with an error status.

For example when implementing error handling or raising an error depending on a functional check.

Using a Rhino scripting action

The syntax for raising an exception with Rhino is simply:

throw "Error message";

Consider the following example.

88 designer

Scripting expression:

__ctx__.publishVariable('/USER_ERROR_MSG', 'Something went wrong in this process');
throw "Error message";

In this example, we also published a variable named "USER_ERROR_MSG" at the root level of the session.

In this way, analysts will be able to find quick information on the error by consulting this variable, for example in Analytics:

88 analytics