Error Handling

If you forward the request to (or create a specific request for) another method or business object, you will get a response or result. Use o.result if you get a result. The result will be included in the message details of the final method result.

In that case you must return DALHOOKERROR. It is not needed to use dal.set.error.message().It is not forbidden either.

If an error occurred and you return DALHOOKERROR but without o.result being filled, it is mandatory to use dal.set.error.message(). In that case a result is automatically created based on the set error message(s).

If you fill o.result, set io.default to true and return the OK value (0), the result will be handled as follows:

  • If the default process succeeds, the messages from the result are included in the response information area.
  • If the default process fails, the messages from the result are included in the method’s result.

In a before or after execute hook for a batch method, you cannot return a result XML. However, you can set a DAL error message and return DALHOOKERROR.

If you set a DAL error message in a before/on/after execute hook but return 0 (OK), then the message is regarded as a warning.