Merge lp:~sergiusens/click-sync/404 into lp:click-sync

Proposed by Sergio Schvezov
Status: Merged
Approved by: Colin Watson
Approved revision: 9
Merged at revision: 9
Proposed branch: lp:~sergiusens/click-sync/404
Merge into: lp:click-sync
Diff against target: 15 lines (+5/-2)
1 file modified
click-sync.py (+5/-2)
To merge this branch: bzr merge lp:~sergiusens/click-sync/404
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+191655@code.launchpad.net

Description of the change

Instead of a traceback raise an exception on != 200 with the click package that odds out

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'click-sync.py'
--- click-sync.py 2013-10-16 19:23:37 +0000
+++ click-sync.py 2013-10-17 14:47:27 +0000
@@ -83,8 +83,11 @@
83 Jenkins uri.83 Jenkins uri.
84 """84 """
85 log.debug(('Getting %s' % click_uri))85 log.debug(('Getting %s' % click_uri))
86 json_job_request = urllib.urlopen(click_uri).read()86 json_request = urllib.urlopen(click_uri)
87 json_content = json.loads(json_job_request)87 if json_request.code != 200:
88 raise RuntimeError('%s returned %s with %s' %
89 (click_uri, json_request.code, json_request.read()))
90 json_content = json.loads(json_request.read())
88 return json_content91 return json_content
8992
9093

Subscribers

People subscribed via source and target branches