diff --git a/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java b/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java index 335375b45..38b1e1e20 100644 --- a/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java +++ b/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/jwt/NacosSignatureAlgorithm.java @@ -203,7 +203,9 @@ public final class NacosSignatureAlgorithm { Mac instance = Mac.getInstance(jcaName); instance.init(key); return instance; - } catch (NoSuchAlgorithmException | InvalidKeyException e) { + } catch (NoSuchAlgorithmException e) { + throw new IllegalArgumentException("No Such Algorithm: " + jcaName); + } catch (InvalidKeyException e) { throw new IllegalArgumentException("Invalid key: " + key); } }