From 23e389b2cd2a0ed5219df9183e68dd6682b81d5f Mon Sep 17 00:00:00 2001 From: mainick Date: Wed, 7 Jan 2026 08:02:25 +0100 Subject: [PATCH] fix: rethrow TokenDecoderException for better error handling --- src/Token/JWKSTokenDecoder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Token/JWKSTokenDecoder.php b/src/Token/JWKSTokenDecoder.php index aa38ccb..d6f3b6c 100644 --- a/src/Token/JWKSTokenDecoder.php +++ b/src/Token/JWKSTokenDecoder.php @@ -94,6 +94,9 @@ public function decode(string $token, string $key): array return json_decode($json, true, 512, JSON_THROW_ON_ERROR); } + catch (TokenDecoderException $e) { + throw $e; + } catch (\JsonException $e) { throw TokenDecoderException::forDecodingError('JSON parsing failed: ' . $e->getMessage(), $e); }