Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Question

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

Answer

Use throwException(String errorMessage)

For details see: https://qa.pricefx.eu/pricefx-api/groovy/develop/net/pricefx/formulaengine/scripting/PublicGroovyAPI.html#throwException-java.lang.String-

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
  • No labels