Skip to main content
Skip table of contents

throwException

Versionshinweise

18.1

Code

GROOVY
void ScriptUtils.throwException(String message[, Throwable cause])

Beschreibung

Erzeugt eine Exception mit der übergebenen Nachricht und dem Grund (optional).

Parameter

  • message - Die Nachricht der Exception.
  • cause - [optional] Die zu Grunde liegende Exception.

Beispiele

GROOVY
if(var == null)
{
	ScriptUtils.throwException("'var' may not be null!");
}
// or
try
{
	// throws exception ... 
}
catch(Exception e)
{
	ScriptUtils.throwException("Script was terminated due to exception!", e);
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.