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

More descriptive parse_number errors #297

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

cobyj33
Copy link
Contributor

@cobyj33 cobyj33 commented Oct 28, 2023

The parse_number structs throw errors through do_from_chars and do_strtod whenever a user enters a numerical argument error, but the errors are extremely undescriptive and give little to no detail on what type or notation was expected.

In order to give more descriptive errors for when parsing numbers fail for this reason, I added try/catch wrappers around the do_from_chars and do_strtod calls in the implemented parse_number templates. Now, the thrown errors will also have a message which displays what type of number the parsed number was expected to be, while maintaining the messages and error types from do_from_chars and do_strtod in the process.

@p-ranav p-ranav merged commit e4d4f67 into p-ranav:master Oct 28, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants