Catch

WMA link


Catch[expr]

returns the argument of the first Throw generated in the evaluation of
expr.

Catch[expr, form]

returns value from the first Throw[valuetag] for which form matches
tag.

Catch[expr, form, f]

returns f[value, tag].

Exit to the enclosing Catch as soon as Throw is evaluated:

Define a function that can “throw an exception”:

The result of Catch is just what is thrown by Throw:

Break
CheckAbort