summaryrefslogtreecommitdiff
path: root/pygerrit/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygerrit/client.py')
-rw-r--r--pygerrit/client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pygerrit/client.py b/pygerrit/client.py
index 5ab3950..976681e 100644
--- a/pygerrit/client.py
+++ b/pygerrit/client.py
@@ -72,7 +72,10 @@ class GerritClient(object):
# According to http://goo.gl/h13HD it should be safe to use the
# presence of the "type" key to determine whether the dictionary
# represents a change or if it's the query status indicator.
- data = decoder.decode(line)
+ try:
+ data = decoder.decode(line)
+ except ValueError, err:
+ raise GerritError("Query returned invalid data: %s", err)
if "type" in data:
if data["type"] == "error":
raise GerritError("Query error: %s" % data["message"])