The .catch token is used to prevent a program from terminating if an error occurs.

It does not behave like the catch keyword in C++.

    Commands ; .catch { Commands } ; Commands 

Additional Information

For information about other control flow tokens and their use in debugger command programs, see Using Debugger Command Programs.


The .catch token is followed by braces enclosing one or more commands.

If a command within a .catch block generates an error, the error message is displayed, all remaining commands within the braces are ignored, and execution resumes with the first command after the closing brace.

If .catch is not used, an error will terminate the entire debugger command program.

You can use .leave to exit from a .catch block.