Skip to content

Errors

CLASS DESCRIPTION
Conflict
Forbidden
NotFound
PlankaError
Unauthorized
UnprocessableEntity
ValidationError
ATTRIBUTE DESCRIPTION
ERRORS

TYPE: dict[str, type[PlankaError]]

ERRORS module-attribute

ERRORS: dict[str, type[PlankaError]] = {'E_CONFLICT': Conflict, 'E_FORBIDDEN': Forbidden, 'E_NOT_FOUND': NotFound, 'E_UNAUTHORIZED': Unauthorized, 'E_UNPROCESSABLE_ENTITY': UnprocessableEntity, 'E_MISSING_OR_INVALID_PARAMS': ValidationError}

Conflict

Conflict(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

Forbidden

Forbidden(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

NotFound

NotFound(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

PlankaError

PlankaError(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: HTTPStatusError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

Unauthorized

Unauthorized(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

UnprocessableEntity

UnprocessableEntity(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)

ValidationError

ValidationError(parent: HTTPStatusError, *args: Any, **kwargs: Any)

Bases: PlankaError

Source code in src/plankapy/v2/api/errors.py
17
18
19
20
21
22
def __init__(self, parent: HTTPStatusError, *args: Any, **kwargs: Any) -> None:
    response_json: dict[str, str] = parent.response.json()
    message = response_json.get('message', 'NO_MESSAGE')
    super().__init__(message, request=parent.request, response=parent.response)
    for problem in response_json.get('problems', []):
        self.add_note(problem)