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

Nested Try/Catch -- How do I clear an error?

  • 1.  Nested Try/Catch -- How do I clear an error?

    Posted Wed October 22, 2008 08:11 PM

    Hi! Kinda new to this, so please bear with me. (I have learned so much from y’all already, but couldn’t find anything on this situation)

    I am having troubles with a nested Try/Catch structure where the second Try/Catch is in a flow service invoked from the main Catch. I am trying to handle a database connection error and send an email to the users with a notification.

    Basic Structure:

    -Try1 (Exit on Failure)
    – Database Read
    – (other stuff)
    – Exit Try1
    -Catch1 (Exit on Done)
    – GetLastError
    – Build Email text
    – Invoke EmailService
    — (Inside EmailService)
    ---- Try2 (Exit on Failure)
    ----- Format and Send email
    ---- Catch2 (Exit on Done)
    ----- Format and send failure email
    — (End EmailService)
    -End Try1/Catch1

    The problem comes in when I invoke the EmailService. The Try2/Catch2 inside the EmailService is picking up the error from Try1/Catch1 and forcing the flow into Catch2.

    By the time the EmailService is called, I no longer need the error details.

    So, is there a way to either “Clear” the error before I invoke the EmailService OR can I somehow scope the EmailService so it will ignore the original error and only handle its own errors?

    Any help would be greatly appreciated.

    -Dan


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: Nested Try/Catch -- How do I clear an error?

    Posted Wed October 22, 2008 09:06 PM

    Never mind… I had an error in my EmailService that was causing the situation.

    It is working fine now.

    -Dan


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services