From 7024aa0e705e522e8e0cc9b4555bb17a5a35ed45 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 2 Mar 2021 10:26:45 -0500 Subject: Added cmd2.exceptions.PassThroughException --- cmd2/cmd2.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd2/cmd2.py') diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 0b198111..d01dfaa0 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -95,6 +95,7 @@ from .exceptions import ( CompletionError, EmbeddedConsoleExit, EmptyStatement, + PassThroughException, RedirectionError, SkipPostcommandHooks, ) @@ -2259,6 +2260,8 @@ class Cmd(cmd.Cmd): raise ex except SystemExit: stop = True + except PassThroughException as ex: + raise ex.wrapped_ex except Exception as ex: self.pexcept(ex) finally: @@ -2269,6 +2272,8 @@ class Cmd(cmd.Cmd): raise ex except SystemExit: stop = True + except PassThroughException as ex: + raise ex.wrapped_ex except Exception as ex: self.pexcept(ex) -- cgit v1.2.1