# HG changeset patch # User catherine@dellzilla # Date 1226071898 18000 # Node ID 8def9dec155f7679a602e0e46fec7ec0709e2e95 # Parent 197a312f2656a8f4f801189aef962a7d1c2e8745 trap errors diff -r 197a312f2656 -r 8def9dec155f cmd2.py --- a/cmd2.py Wed Nov 05 14:16:24 2008 -0500 +++ b/cmd2.py Fri Nov 07 10:31:38 2008 -0500 @@ -330,7 +330,11 @@ 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)