Scripting Python eqivalent of RhinoScript On Error Resume Next

Hi Guys,

Maybe a silly question, but how do I tell Python script to not stop and exit on errors, similar way to what On Error Resume Next does for RhinoScripts ?

–jarek

Hi @Jarek,

In Python, you can use exception handling for this kind of thing.

try:
    # something
except:
   # raise error or do something else
1 Like

thanks! I will give it a shot

1 Like

Sure. :wink:

Note the section on catching specific exceptions. You can spend a very long time trying to debug an unexpected error in a try…except block :slight_smile:

Guys - thank you very much - this is all great info, and a good warning.
I need it for something tiny and harmless for now, but I can see using ‘try’ posing some danger once the code grows. Same with “On Error Resume Next” in VBS, actually…

–jarek