Skip to content

Commit

Permalink
fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Karina5005 committed Jul 28, 2023
1 parent 5ddac1e commit ef8ed93
Show file tree
Hide file tree
Showing 2 changed files with 560 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backup_github/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ def raise_by_status(self, response):
if response.status_code == 403:
logging.warning("Status is 403 - Rate limit exceeded exception")
raise self.RateLimitExceededException(
json.loads(response.content)["message"]
json.loads(response.content)
)
elif response.status_code == 404:
logging.warning(
f"Status is {response.status_code} - Client error: Not found"
)
raise self.ClientError(json.loads(response.content)["message"])
raise self.ClientError(json.loads(response.content))
elif 400 <= response.status_code < 500:
logging.warning(f"Status is {response.status_code} - Client error")
raise self.ClientError(json.loads(response.content)["message"])
raise self.ClientError(json.loads(response.content))
elif 500 <= response.status_code < 600:
logging.warning(f"Status is {response.status_code} - Server error")
raise self.ServerError(json.loads(response.content)["message"])
raise self.ServerError(json.loads(response.content))

def retry(func):
def ret(self, *args, **kwargs):
Expand Down
Loading

0 comments on commit ef8ed93

Please sign in to comment.