JWKS Caching Strategy Recommendations

Yes, you will receive different error messages based on the reason.

For authorization token It might be something like:

UnauthorizedError: No authorization token was found
or
UnauthorizedError: Authorization token in invalid

For the JWKS it’s JsonWebTokenError, JsonWebKeySetsError or jwks Failure: Error: followed by the reason. It can either be Invalid certificate or Invalid signing key.