Access error details in catch step


I would like to return my own document in an catch step instead of Adapter::error. However, I do not know how to get the error information. I guess there should be a way to access the same information as Adapter::error (errorCategory, errorText).
I would be glad if someone could give me a hint :wink:

thank you … Rick


I don’t believe you can access errorCategory, other than it seems like most times I’ve gotten an error they are System errors. To get the text of the error message, it requires 3 steps.

  1. Near the top of the script (integration component), declare a string var:

private String exceptionText = “”;

  1. Under the catchStep, save the exception text to the sting var:

catch (AdapterException catchStepEx)
// save the exception text
exceptionText = catchStepEx.toString

  1. Now in the catch path, add a custom code step. Set it’s Output Return Type to ‘unicode string’. This will allow you to expose the exception text so that you can map it to documents and such.

private String exposeExceptionMethod()
throws AdapterException, BrokerException
return exceptionText;

Opps, forgot to mention that the return value in step 3 should be the parameter declared in step 1.