Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 3cc6572

Browse files
author
Kristina Chodorow
committed
add operation failure handler
1 parent d5c0855 commit 3cc6572

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def _cmd(self, args, out, name = None, db = None, collection = None):
111111
out('{"ok" : 0, "errmsg" : "wasn\'t connected to the db and '+
112112
'couldn\'t reconnect", "name" : "%s"}' % name)
113113
return
114+
except OperationFailure, error:
115+
out('{"ok" : 0, "errmsg" : "%s"}' % error)
116+
return
114117

115118
# debugging
116119
if result['ok'] == 0:

0 commit comments

Comments
 (0)