Skip to content

Commit 1af0994

Browse files
authored
Update README.md
1 parent 9214d76 commit 1af0994

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ print_r($claims2); // ['id' => 13, 'is-admin' => true]
305305
### Error Handling
306306

307307
Here are the exceptions that the package might throw:
308+
308309
* Encoding:
309310
* [InvalidKeyException](src/Exceptions/InvalidKeyException.php) when the provided key is not valid.
310311
* [JsonEncodingException](src/Exceptions/JsonEncodingException.php) when cannot convert the provided claims to JSON.
@@ -318,6 +319,9 @@ Here are the exceptions that the package might throw:
318319
* [NoKidException](src/Exceptions/NoKidException.php) when there is no `kid` in the token header.
319320
* [VerifierNotFoundException](src/Exceptions/VerifierNotFoundException.php) when no key/verifier matches the `kid` in the token header.
320321

322+
All of the exceptions mentioned are subclasses of the `JwtException` exception.
323+
By catching `JwtException`, you can handle all these cases collectively instead of catching each one individually.
324+
321325
## License
322326
PHP-JWT is initially created by [Milad Rahimi](http://miladrahimi.com)
323327
and released under the [MIT License](http://opensource.org/licenses/mit-license.php).

0 commit comments

Comments
 (0)