Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JIRAError to correctly include full details #86

Merged
merged 1 commit into from Jul 15, 2015

Conversation

asqui
Copy link
Contributor

@asqui asqui commented Jun 13, 2015

This fixes #85

str(JIRAError) now includes full details of any server-side errors.

The problems in the str implementation are threefold:

  1. The response.text block checks for the text attribute but then uses
    the headers attribute (cut-and-paste error from the lines above)
  2. The response object is "Truthy" based upon the HTTP response, so in
    the case of an HTTP error it is actually "False" so the conditional
    check fails and response details are not included.
  3. Finally, the format string is invalid and causes an exception
    because it is missing a %s at the end.

These problems have all been addressed in this commit.

str(JIRAError) now includes full details of any server-side errors.

The problems in the __str__ implementation are threefold:
1. The response.text block checks for the text attribute but then uses
   the headers attribute (cut-and-paste error from the lines above)
2. The response object is "Truthy" based upon the HTTP response, so in
   the case of an HTTP error it is actually "False" so the conditional
   check fails and response details are not included.
3. Finally, the format string is invalid and causes an exception
   because it is missing a %s at the end.

These problems have all been addressed in this commit.
ssbarnea added a commit that referenced this pull request Jul 15, 2015
Fix JIRAError to correctly include full details
@ssbarnea ssbarnea merged commit 05d44d4 into pycontribs:master Jul 15, 2015
@asqui asqui deleted the JIRAError_fixes branch July 15, 2015 11:37
ssbarnea added a commit that referenced this pull request Nov 21, 2016
Fix JIRAError to correctly include full details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIRAError does not correctly display full error information
2 participants