Skip to main content
July 7, 2011
Question

Exception handling question

  • July 7, 2011
  • 1 reply
  • 325 views

Hi all,

I have the following script:

try{

    doProcess1();

    doProcess2();

    doProcess3();

}

catch{

    processException();

}

Is there a clean way to rewrite this script such that when there is an exception in doProcess1(), the control flow is returned to doProcess2() after the exception is handled?

In other words, I want to do like below, but perhaps in a cleaner way?

try{

    doProcess1();

}

catch{

     processException();

}

try{

     doProcess2();

}

catch{

     processException();

}

try{

     doProcess3();

}

catch{

     processException();

}

Thank you!

    This topic has been closed for replies.

    1 reply

    Inspiring
    July 7, 2011

    Nope: there is no ON ERROR RESUME or ON ERROR GOTO (thankfully, in the case of the latter) in CF.

    The only way you can do it is the second way you yourself describe.

    --

    Adam