How do I throw an exception?


Just throw a new Exception("Xxx")? That gives me Unexpected type: java.lang.Exception. Is there some exception class I can use for this?


Use throwException(String errorMessage)

For details see:

A calculation logic can stop its execution and fail by throwing an exception, for example:

if (api.userEntry("margin") <0) then api.throwException("I won't let you go bankrupt") else price=cost+margin

Found an issue in documentation? Write to us.