[docs]
class BadRequestError(Exception):
"""
Bad Request error.
This exception should be raised when we want to return an HTTP 400 Bad Request
"""
pass
[docs]
class InternalServerError(Exception):
"""
Bad Request error.
This exception should be raised when we want to return an HTTP 400 Bad Request
"""
pass
[docs]
class InvalidInternalStateError(InternalServerError):
"""
This is specification of InternalServerError that specify that the internal
error is caused by an invalid backend, storage or cache state.
"""
pass
[docs]
class FinalizedSessionError(BadRequestError):
"""
Raised when an authorization request or respsonse attempts at updating or modifying
an already finalized authentication session.
"""
pass
[docs]
class DiscoveryFailedError(Exception):
"""
Raised when the discovery fails
"""
pass
[docs]
class HTTPError(Exception):
"""
Raised when an error occurs during an HTTP request
"""
pass
[docs]
class EmptyHTTPError(HTTPError):
"""
Default HTTP empty error
"""
pass
[docs]
class AuthorizeUnmatchedResponse(Exception):
"""
Raised when an authorization response cannot be matched to an authentication request
"""
pass
[docs]
class InvalidRequestException(Exception):
"""
Exception raised when a request is invalid according to OpenID4VCI specifications.
Attributes:
message (str): A human-readable explanation of why the request is invalid.
"""
def __init__(self, message: str):
"""
Initializes the exception with a descriptive error message.
Args:
message (str): Description of the invalid request.
"""
super().__init__(message)
self.message = message