summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmr <dradetsky@gmail.com>2018-03-29 08:27:18 -0700
committerJosé Padilla <jpadilla@webapplicate.com>2018-03-29 11:27:18 -0400
commitee2ab9fbd78f884629833feedffdc69a9d580b89 (patch)
treef0a3aecedd267be5cd2349e454078310d2a6f1a6
parent54a39aec6a0289ad0fa920dff214753cab9339b9 (diff)
downloadpyjwt-ee2ab9fbd78f884629833feedffdc69a9d580b89.tar.gz
all exceptions inherit from PyJwtError (#340)
* all exceptions inherit from PyJwtError * s/Jwt/JWT/ * add to init
-rw-r--r--jwt/__init__.py1
-rw-r--r--jwt/exceptions.py11
2 files changed, 10 insertions, 2 deletions
diff --git a/jwt/__init__.py b/jwt/__init__.py
index 823128d..3e4826b 100644
--- a/jwt/__init__.py
+++ b/jwt/__init__.py
@@ -27,4 +27,5 @@ from .exceptions import (
InvalidIssuedAtError, InvalidIssuerError, ExpiredSignature,
InvalidAudience, InvalidIssuer, MissingRequiredClaimError,
InvalidSignatureError,
+ PyJWTError,
)
diff --git a/jwt/exceptions.py b/jwt/exceptions.py
index b396bf1..2a6aa59 100644
--- a/jwt/exceptions.py
+++ b/jwt/exceptions.py
@@ -1,4 +1,11 @@
-class InvalidTokenError(Exception):
+class PyJWTError(Exception):
+ """
+ Base class for all exceptions
+ """
+ pass
+
+
+class InvalidTokenError(PyJWTError):
pass
@@ -30,7 +37,7 @@ class ImmatureSignatureError(InvalidTokenError):
pass
-class InvalidKeyError(Exception):
+class InvalidKeyError(PyJWTError):
pass