summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatherine Devlin <catherine.devlin@gmail.com>2008-11-07 10:31:38 -0500
committerCatherine Devlin <catherine.devlin@gmail.com>2008-11-07 10:31:38 -0500
commit22f98966d56c20049ff1f653c23fda4b60404e3b (patch)
treeff41779bea2c744a48953eaa05f305c6b7ebeb66
parent3198d7fa6743e3c8afde2db091db58a8bd493e3e (diff)
downloadcmd2-git-0.4.3.tar.gz
trap errors0.4.3
-rwxr-xr-xcmd2.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index bcbce8ee..4fe3db97 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -330,7 +330,11 @@ class Cmd(cmd.Cmd):
self.stdout = tempfile.TemporaryFile()
if statement.output == '>>':
self.stdout.write(getPasteBuffer())
- stop = cmd.Cmd.onecmd(self, statement.statement)
+ try:
+ stop = cmd.Cmd.onecmd(self, statement.statement)
+ except Exception, e:
+ print str(e)
+ return False
try:
if statement.command not in self.excludeFromHistory:
self.history.append(statement.fullStatement)