(1.0.4) pylint fixes
This commit is contained in:
parent
33b63fecc4
commit
7b0b13604b
4 changed files with 8 additions and 10 deletions
|
@ -1,19 +1,19 @@
|
|||
class InternalServerError(Exception):
|
||||
"""Raised when the API returns a 5xx status code"""
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super(InternalServerError, self).__init__(message)
|
||||
|
||||
class ClientError(Exception):
|
||||
"""Raised when the API returns a 4xx status code"""
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super(ClientError, self).__init__(message)
|
||||
|
||||
class TooManyRequests(Exception):
|
||||
"""Raised when the API returns a 429 status code"""
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super(TooManyRequests, self).__init__(message)
|
||||
|
||||
class RetryLimitExceeded(Exception):
|
||||
"""Raised when the retry limit is exceeded"""
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
super(RetryLimitExceeded, self).__init__(message)
|
||||
|
|
|
@ -64,12 +64,10 @@ class RestAdapter:
|
|||
try:
|
||||
if result.status_code == 429:
|
||||
raise TooManyRequests(f"{result.message} - {result.data}")
|
||||
elif 400 <= result.status_code < 500:
|
||||
if 400 <= result.status_code < 500:
|
||||
raise ClientError(f"{result.status_code} - {result.message} - {result.data}")
|
||||
elif 500 <= result.status_code < 600:
|
||||
if 500 <= result.status_code < 600:
|
||||
raise InternalServerError(f"{result.status_code} - {result.message} - {result.data}")
|
||||
else:
|
||||
pass
|
||||
except (TooManyRequests, InternalServerError) as e:
|
||||
if retry_counter < self.config.retry_limit:
|
||||
interval = self.config.interval * retry_counter
|
||||
|
|
|
@ -1 +1 @@
|
|||
VERSION = "1.0.3"
|
||||
VERSION = "1.0.4"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "pyflowery"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
description = "A Python API wrapper for the Flowery API"
|
||||
authors = ["cswimr <seaswimmerthefsh@gmail.com>"]
|
||||
license = "GPL 3.0-only"
|
||||
|
|
Loading…
Reference in a new issue