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.
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:
Comments
How to update USER_ERROR_MSG with the message?
When i test , i get this error message :
javax.script.ScriptException: Error message in at line number 1
Is that normal?