pymel.core.language.Catch

digraph inheritance7109e1a8e1 { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "Catch" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.language.Catch",style="setlinewidth(0.5)",tooltip="Reproduces the behavior of the mel command of the same name. if writing",height=0.25,shape=box,fontsize=8]; }

class Catch

Reproduces the behavior of the mel command of the same name. if writing pymel scripts from scratch, you should use the try/except structure. This command is provided for python scripts generated by py2mel. stores the result of the function in catch.result.

>>> if not catch( lambda: myFunc( "somearg" ) ):
...    result = catch.result
...    print "succeeded:", result
reset()
result = None
success = None