Source code for pystac_client.exceptions
from requests import Response
[docs]
class APIError(Exception):
"""Raised when unexpected server error."""
status_code: int | None
[docs]
@classmethod
def from_response(cls, response: Response) -> "APIError":
error = cls(response.text)
error.status_code = response.status_code
return error
[docs]
class ParametersError(Exception):
"""Raised when invalid parameters are used in a query"""