Skip to content

Catch

Catch[e] catches and returns any Thrown expressions, if any. Otherwise returns the result of e.

Attributes[Catch] := {HoldFirst, Protected}

Simple examples

In[1]:= Catch[CompoundExpression[a, b, Throw[c], d, e]]
Out[1]= c
In[2]:= Catch[{a, b, Throw[c], d}]
Out[2]= c