Welcome Guest! Log in


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

 

Comments  

# Virginie_Samson 2016-03-23 14:45
Hello
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?
# Thomas BLETON 2016-03-24 11:31
No it is not :) I added an example to the article. Is your syntax similar ?

You have no rights to post comments

Articles

Suggest a new Article!