forked from pycontribs/jira
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sorin Sbarnea
committed
Oct 11, 2015
1 parent
39fe9e9
commit adf8e07
Showing
9 changed files
with
73 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class JIRAError(Exception): | ||
|
||
"""General error raised for all problems in operation of the client.""" | ||
|
||
def __init__(self, status_code=None, text=None, url=None, request=None, response=None, **kwargs): | ||
self.status_code = status_code | ||
self.text = text | ||
self.url = url | ||
self.request = request | ||
self.response = response | ||
self.headers = kwargs.get('headers', None) | ||
|
||
def __str__(self): | ||
t = "JiraError HTTP %s" % self.status_code | ||
if self.text: | ||
t += "\n\ttext: %s" % self.text | ||
if self.url: | ||
t += "\n\turl: %s" % self.url | ||
|
||
if self.request is not None and hasattr(self.request, 'headers'): | ||
t += "\n\trequest headers = %s" % self.request.headers | ||
|
||
if self.request is not None and hasattr(self.request, 'text'): | ||
t += "\n\trequest text = %s" % self.request.text | ||
|
||
if self.response is not None and hasattr(self.response, 'headers'): | ||
t += "\n\tresponse headers = %s" % self.response.headers | ||
|
||
if self.response is not None and hasattr(self.response, 'text'): | ||
t += "\n\tresponse text = %s" % self.response.text | ||
|
||
t += '\n' | ||
return t | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
ipython>=0.13 | ||
pytest-cache | ||
ipython>=4.0.0 | ||
unittest2 | ||
ordereddict | ||
PyJWT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters