Script abort
Syntax
throw($message)
throw($message, $detail)
Description
Generates an error message on the user interface. The script will be aborted.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
message | String/Internationalized text | The main message. | yes | |
detail | String/Internationalized text | Details about message . |
no | No details. |
Examples
Message with strings
throw('Error', 'Invalid username');
Output:
Message with internationalized texts)
{
message = #("Fehler"@de, "Error"@en);
details = #("Ungültiger Username"@de, "Invalid username"@en);
throw($message, $details);
}
Output:
German:
English:
Script abort by message
{
userName = "test";
if($suerName.length() < 8, throw("Name to short!", "Choose a longer username"), info("Good Name!"));
a = new(`my.module:MyClass`);
$a.set(`my.module:MyClass#userName`, $userName);
}
Output:
The script is aborted and no new object is created with the username.