Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Exception handling question

Guest
Jul 07, 2011 Jul 07, 2011

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!

302
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2011 Jul 07, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources