Source code for psnawp_api.core.psnawp_exceptions
"""Provide exception classes for the psnawp package."""
[docs]
class PSNAWPError(Exception):
"""Base Exception for all PSNAWP Exceptions."""
[docs]
class PSNAWPServerError(PSNAWPError):
"""Exception raised if there is a problem at the server."""
[docs]
class PSNAWPClientError(PSNAWPError):
"""Exception raised if there is a problem at the client."""
[docs]
class PSNAWPAuthenticationError(PSNAWPClientError):
"""Exception for authentication related errors."""
[docs]
class PSNAWPBadRequestError(PSNAWPClientError):
"""Exception raised if bad request is made to the endpoint."""
[docs]
class PSNAWPIllegalArgumentError(PSNAWPClientError):
"""Exception raised if user gave wrong input to a function."""
[docs]
class PSNAWPUnauthorizedError(PSNAWPClientError):
"""Exception for accessing an action is not allowed due to missing the right authorization."""
[docs]
class PSNAWPInvalidTokenError(PSNAWPClientError):
"""Exception raised if user gave unparsable npsso token string."""
[docs]
class PSNAWPForbiddenError(PSNAWPClientError):
"""Exception for accessing an action is not allowed due to insufficient rights to a resource."""
[docs]
class PSNAWPNotFoundError(PSNAWPClientError):
"""Exception raised if resource not found."""
[docs]
class PSNAWPNotAllowedError(PSNAWPClientError):
"""Exception raised if resource doesn't support this method."""
[docs]
class PSNAWPTooManyRequestsError(PSNAWPClientError):
"""Exception raised if client sends too many requests."""