IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Access error details in catch step

  • 1.  Access error details in catch step

    Posted Fri January 04, 2002 03:46 AM

    Hello

    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


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Access error details in catch step

    Posted Tue January 08, 2002 02:05 PM

    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:

    try
    {
    }
    catch (AdapterException catchStepEx)
    {
    // save the exception text
    exceptionText = catchStepEx.toString
    catchStepCatch();
    }

    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;
    }


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 3.  RE: Access error details in catch step

    Posted Tue January 08, 2002 04:34 PM

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


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB