About errors

Exit classes can return errors. Some errors are only prompted to the user in a dialog while others can be displayed on the screen as a dialog message as well as registered in the errors panel of the Interplay application.

Errors implement the com.axway.interplay.api.business.BusinessError interface. They are created using the error factory that is provided as parameter of the exit method.

ErrorFactory.createError(String errorCode, String description, Object checkedObject,, String field)

or

ErrorFactory.createError(String errorCode, String description, Object checkedObject,String field, Object[] parameters)

Once the error is created, you can complete the Error fields by setting the attributes:

  • Error code: the error code is displayed in the error panel and used as a key to find in the dictionary the label to display in the Error dialog.
  • Description: description of the error.
  • Parameters: array of values that replaces the placeholders in the label.
  • Custom properties: up to five custom properties on the errors.
  • Field: the field in error.
  • Level: the level of the error.
  • Possible values are:
  • Level Value Description
    BusinessError.ERROR_LEVEL 0 Blocking error; you cannot leave the field until the error is fixed.
    BusinessError.WARNING_LEVEL 1 Non-blocking error; you can keep the value and leave the field.
  • Origin: origin of the error.
    Possible origins are:
Origin When they are created When they are deleted
EXTERNAL At import time they are read from the imported files. When the parent object is deleted.
SAVE At save time by the system exits or by user exists. At save time, if they do not occur anymore.
TRANSFORMATION At import time by the TransformImportFunction exit. When they are marked as solved and the user clicks save

Examples

In the exit

BusinessError error = errorFactory.createError(bo);

error.setErrorCode("errorCode");

error.setDescription("description)");

error.setOrigin(“SAVE”);

error.addParameter("value");

error.addParameter("Market");

In the dictionary

errorCode = ‘{0}’ is not authorized for “{1}”

Related Links