Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions flask_jwt_extended/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
class JWTExtendedException(Exception):
"""
Base except which all flask_jwt_extended errors extend
Base exception which all flask_jwt_extended errors extend.
"""

pass


class JWTDecodeError(JWTExtendedException):
"""
An error decoding a JWT
An error decoding a JWT.
"""

pass


class InvalidHeaderError(JWTExtendedException):
"""
An error getting header information from a request
An error getting header information from a request.
"""

pass


class InvalidQueryParamError(JWTExtendedException):
"""
An error when a query string param is not in the correct format
An error when a query string param is not in the correct format.
"""

pass


class NoAuthorizationError(JWTExtendedException):
"""
An error raised when no authorization token was found in a protected endpoint
An error raised when no authorization token was found in a protected endpoint.
"""

pass


class CSRFError(JWTExtendedException):
"""
An error with CSRF protection
An error with CSRF protection.
"""

pass
Expand All @@ -49,15 +49,15 @@ class CSRFError(JWTExtendedException):
class WrongTokenError(JWTExtendedException):
"""
Error raised when attempting to use a refresh token to access an endpoint
or vice versa
or vice versa.
"""

pass


class RevokedTokenError(JWTExtendedException):
"""
Error raised when a revoked token attempt to access a protected endpoint
Error raised when a revoked token attempts to access a protected endpoint.
"""

def __init__(self, jwt_header: dict, jwt_data: dict) -> None:
Expand All @@ -68,8 +68,8 @@ def __init__(self, jwt_header: dict, jwt_data: dict) -> None:

class FreshTokenRequired(JWTExtendedException):
"""
Error raised when a valid, non-fresh JWT attempt to access an endpoint
protected by fresh_jwt_required
Error raised when a valid, non-fresh JWT attempts to access an endpoint
protected by fresh_jwt_required.
"""

def __init__(self, message, jwt_header: dict, jwt_data: dict) -> None:
Expand All @@ -93,7 +93,7 @@ def __init__(self, message, jwt_header: dict, jwt_data: dict) -> None:
class UserClaimsVerificationError(JWTExtendedException):
"""
Error raised when the claims_verification_callback function returns False,
indicating that the expected user claims are invalid
indicating that the expected user claims are invalid.
"""

def __init__(self, message, jwt_header: dict, jwt_data: dict) -> None:
Expand Down