Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an error_code based interface #72

Closed
Thalhammer opened this issue Jun 26, 2020 · 1 comment
Closed

Provide an error_code based interface #72

Thalhammer opened this issue Jun 26, 2020 · 1 comment

Comments

@Thalhammer
Copy link
Owner

Thalhammer commented Jun 26, 2020

Currently jwt-cpp uses exceptions to signal errors and bad tokens.
In some environments exceptions might not be wanted (performance critical code) or not available (embedded).
In order to support this we need to convert all internal functions to use error codes.

Following the standard, an error_category should be unique in a given process. This is pretty much impossible for a header only library, but we should at least provide the option to have it compliant. One option would be to provide some preprocessor defines, which (when defined) will use extern to get the error category and a second one to emit the implementation in a translation unit. It then would be the users responsibility to make sure the actuall implementation resides in the main process and all other code has the extern option defined.

@prince-chrismc
Copy link
Collaborator

fixed with #86 and #90

If there is nothing missing this can be clsoed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants