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

Please have one base exception class for all json exceptions #1427

Closed
yurivict opened this issue Jan 12, 2019 · 1 comment
Closed

Please have one base exception class for all json exceptions #1427

yurivict opened this issue Jan 12, 2019 · 1 comment

Comments

@yurivict
Copy link

I do

  try {
    // some code processing json
  } catch (nlohmann::json::parse_error e) {
    // process exception
  }  ...

But it also throws nlohmann::detail::type_error and other exceptions.
Please consider having one base class for all exceptions, so that the users can just have one catch clause for all of them. Otherwise, it seems that they need to have at least 5 catch statements for json errors now.

@yurivict
Copy link
Author

Invalid.

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

No branches or pull requests

1 participant