File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/src/main/java/com/auth0/jwt/impl Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,17 @@ static ObjectMapper getDefaultObjectMapper() {
4949
5050 @ SuppressWarnings ("WeakerAccess" )
5151 <T > T convertFromJSON (String json , Class <T > tClazz ) throws JWTDecodeException {
52- JWTDecodeException exception = new JWTDecodeException (String .format ("The string '%s' doesn't have a valid JSON format." , json ));
5352 if (json == null ) {
54- throw exception ;
53+ throw exceptionForInvalidJson ( null ) ;
5554 }
5655 try {
5756 return mapper .readValue (json , tClazz );
5857 } catch (IOException e ) {
59- throw exception ;
58+ throw exceptionForInvalidJson ( json ) ;
6059 }
6160 }
61+
62+ private JWTDecodeException exceptionForInvalidJson (String json ) {
63+ return new JWTDecodeException (String .format ("The string '%s' doesn't have a valid JSON format." , json ));
64+ }
6265}
You can’t perform that action at this time.
0 commit comments