MCPcopy Create free account
hub / github.com/DeepL/deepl-python / DeepLException

Class DeepLException

deepl/exceptions.py:10–28  ·  view source on GitHub ↗

Base class for deepl module exceptions. :param message: Message describing the error that occurred. :param should_retry: True if the request would normally be retried following this error, otherwise false. :param http_status_code: The HTTP status code in the response, if

Source from the content-addressed store, hash-verified

8
9
10class DeepLException(Exception):
11 """Base class for deepl module exceptions.
12
13 :param message: Message describing the error that occurred.
14 :param should_retry: True if the request would normally be retried
15 following this error, otherwise false.
16 :param http_status_code: The HTTP status code in the response, if
17 applicable, otherwise None.
18 """
19
20 def __init__(
21 self,
22 message: str,
23 should_retry: bool = False,
24 http_status_code: Optional[int] = None,
25 ):
26 super().__init__(message)
27 self.should_retry = should_retry
28 self.http_status_code = http_status_code
29
30
31class AuthorizationException(DeepLException):

Callers 5

_raise_for_statusMethod · 0.85
get_glossary_entriesMethod · 0.85
_prepare_requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected