Replies: 1 comment 3 replies
-
Sounds good. Would you give the PR a shot? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It'd be great if
JOSEError
, and the errors that extend it, had static error codes.For example:
This is just to make it possible to get the code, without having to create a new instance of the class.
In our use case, we emit a metric with the error code on some failures. The unit tests look like:
which isn't nearly as clean as:
I imagine there are other cases where developers may find this a cleaner solution.
I'd be happy to submit this PR if it's something you'd like it. Either way, thanks for the great library!
Beta Was this translation helpful? Give feedback.
All reactions