summaryrefslogtreecommitdiff
path: root/pygerrit/stream.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2012-10-23 15:52:26 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2012-10-23 15:52:29 +0900
commite81b56eef5c10c012dc395bf978a793069de786e (patch)
tree7e4b9d6a5af8956486b863f5337013bcf05d2887 /pygerrit/stream.py
parent6ad55e4effa3b3e1354708b5ccba7b4d7ee149ab (diff)
downloadpygerrit-e81b56eef5c10c012dc395bf978a793069de786e.tar.gz
More exception handling in stream
Handle IOError that can occur when reading from the stream, and ValueError that can be raised by the JSON parser. Change-Id: Ic9dc60e048f0f747daf8b34c7b6d8d90c11bb1e0
Diffstat (limited to 'pygerrit/stream.py')
-rw-r--r--pygerrit/stream.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygerrit/stream.py b/pygerrit/stream.py
index f9ad55e..2af49d1 100644
--- a/pygerrit/stream.py
+++ b/pygerrit/stream.py
@@ -74,7 +74,7 @@ class GerritStream(Thread):
line = stdout.readline()
json_data = json.loads(line)
self._gerrit.put_event(json_data)
- except GerritError, e:
+ except (GerritError, ValueError, IOError), e:
error = json.loads('{"type":"gerrit-stream-error",'
'"error":"%s"}' % str(e))
self._gerrit.put_event(error)