Skip to content

Commit

Permalink
Revert fragments commited by mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aciek committed Aug 6, 2023
1 parent af26409 commit 80f12bd
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions wlc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ def __init__(self, message: Optional[str] = None):
class WeblateThrottlingError(WeblateException):
"""Throttling on the server."""

def __init__(self, limit: str, retry_after: str):
self.limit = limit
self.retry_after = retry_after
segments = [self.__doc__]
if limit:
segments.append(f"Limit is {limit} requests.")
if retry_after:
segments.append(f"Retry after {retry_after} seconds.")
super().__init__(" ".join(segments))


class WeblatePermissionError(WeblateException):
"""You don't have permission to access this object."""
Expand Down Expand Up @@ -125,9 +115,7 @@ def process_error(self, error):

if status_code == 429:
headers = error.response.headers
raise WeblateThrottlingError(
headers.get("X-RateLimit-Limit"), headers.get("Retry-After")
)
raise WeblateThrottlingError from error
if status_code == 404:
raise WeblateException(
"Object not found on the server "
Expand Down

0 comments on commit 80f12bd

Please sign in to comment.