Closes gh-10222

This commit is contained in:
Ayush Kohli 2021-08-23 23:48:15 -05:00 committed by Josh Cummings
parent 1cfe84922c
commit f1691370d6
1 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ public final class NimbusJwtDecoder implements JwtDecoder {
catch (RemoteKeySourceException ex) { catch (RemoteKeySourceException ex) {
this.logger.trace("Failed to retrieve JWK set", ex); this.logger.trace("Failed to retrieve JWK set", ex);
if (ex.getCause() instanceof ParseException) { if (ex.getCause() instanceof ParseException) {
throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set")); throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set"), ex);
} }
throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex); throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex);
} }
@ -175,7 +175,7 @@ public final class NimbusJwtDecoder implements JwtDecoder {
catch (Exception ex) { catch (Exception ex) {
this.logger.trace("Failed to process JWT", ex); this.logger.trace("Failed to process JWT", ex);
if (ex.getCause() instanceof ParseException) { if (ex.getCause() instanceof ParseException) {
throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed payload")); throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed payload"), ex);
} }
throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex); throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex);
} }