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