Merge lp:~ramy-asselin/python-jenkins/python-jenkins into lp:~python-jenkins-developers/python-jenkins/trunk

Proposed by Ramy Asselin
Status: Needs review
Proposed branch: lp:~ramy-asselin/python-jenkins/python-jenkins
Merge into: lp:~python-jenkins-developers/python-jenkins/trunk
Diff against target: 15 lines (+3/-1)
1 file modified
jenkins/__init__.py (+3/-1)
To merge this branch: bzr merge lp:~ramy-asselin/python-jenkins/python-jenkins
Reviewer Review Type Date Requested Status
James E. Blair Pending
Review via email: mp+215063@code.launchpad.net

Description of the change

  Add more details to jenkins_open HTTP errors.

  Currently jenkins_open assumes errors to be authentication.
  In some cases, it is a real 500 error which include a java stack trace.
  Update the exception to include the full contents of the http error
  response to aid in corrective action.

To post a comment you must log in.

Unmerged revisions

23. By Ramy Asselin

Add more details to jenkins_open HTTP errors.

Currently jenkins_open assumes errors to be authentication.
In some cases, it is a real 500 error which include a java stack trace.
Update the exception to include the full contents of the http error
response to aid in corrective action.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jenkins/__init__.py'
2--- jenkins/__init__.py 2013-09-28 20:00:43 +0000
3+++ jenkins/__init__.py 2014-04-09 23:11:25 +0000
4@@ -231,9 +231,11 @@
5 # Jenkins's funky authentication means its nigh impossible to
6 # distinguish errors.
7 if e.code in [401, 403, 500]:
8+ contents = e.read()
9 raise JenkinsException(
10 'Error in request.' +
11- 'Possibly authentication failed [%s]' % (e.code)
12+ 'Possibly authentication failed? Code: [%s] '
13+ 'Response: [%s]' % (e.code, contents)
14 )
15 # right now I'm getting 302 infinites on a successful delete
16

Subscribers

People subscribed via source and target branches