summaryrefslogtreecommitdiff
path: root/jwt/api_jws.py
diff options
context:
space:
mode:
authorGabriel Gironda <gabriel@thegroundwork.com>2015-07-23 08:50:49 -0400
committerGabriel Gironda <gabriel@thegroundwork.com>2015-07-23 08:50:49 -0400
commit2a93fc591805af3608de3330a3fd32bf5d4e9380 (patch)
tree6704bf03a161d72d3844806b13ac8a17d671c0b0 /jwt/api_jws.py
parent91fe6cd68978620845e8c56f17348d0d8e042246 (diff)
downloadpyjwt-2a93fc591805af3608de3330a3fd32bf5d4e9380.tar.gz
Change TypeError on bad `kid` to InvalidTokenError
Diffstat (limited to 'jwt/api_jws.py')
-rw-r--r--jwt/api_jws.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/jwt/api_jws.py b/jwt/api_jws.py
index a763638..3e79d41 100644
--- a/jwt/api_jws.py
+++ b/jwt/api_jws.py
@@ -6,7 +6,7 @@ from collections import Mapping
from .algorithms import Algorithm, get_default_algorithms # NOQA
from .compat import string_types, text_type
-from .exceptions import DecodeError, InvalidAlgorithmError
+from .exceptions import DecodeError, InvalidAlgorithmError, InvalidTokenError
from .utils import base64url_decode, base64url_encode, merge_dict
@@ -190,7 +190,7 @@ class PyJWS(object):
def _validate_kid(self, kid):
if not isinstance(kid, string_types):
- raise TypeError('Key ID header parameter must be a string')
+ raise InvalidTokenError('Key ID header parameter must be a string')
_jws_global_obj = PyJWS()
encode = _jws_global_obj.encode