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



# Virginie_Samson 2016-03-23 14:45
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 ?
# jledrezen 2021-02-25 16:30
Lorsque je test l'objet de scripting j'obtiens cette erreur : Error message (#2) in at line number 2.
Est-ce qu'il y a un "scripting connection" ou un "Module" à renseigner ?

You have no rights to post comments


Suggest a new Article!