Skip to content

Commit

Permalink
catching Throwable interface when some error occur
Browse files Browse the repository at this point in the history
  • Loading branch information
dersonsena authored Aug 2, 2022
1 parent 16861d4 commit 479bc3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JWTTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function decodeToken(string $token): stdClass
{
try {
return JWT::decode($token, $this->secretKey, [$this->algorithm]);
} catch (ExpiredException $e) {
throw new UnauthorizedHttpException('Authentication token is expired.');
} catch (\Throwable $e) {
throw new UnauthorizedHttpException($e->getMessage());
}
}

Expand Down

0 comments on commit 479bc3a

Please sign in to comment.