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

Feature request: Exceptions should give more descriptive error messages #108

Open
muesli4 opened this issue Feb 24, 2018 · 0 comments
Open

Comments

@muesli4
Copy link

muesli4 commented Feb 24, 2018

Just giving the class name is not really useful for the user. Otherwise it is a lot of work for a programmer to get all the details out of the exact exception type (or even list all of them in catch clauses).

Proposed solutions:

  • If support for C++11 is available: Inherit from std::runtime_error and use delegating constructors to initialize it with the correct error message (e.g. depending on path etc.).
  • Otherwise: Add a protected std::string member to class ConfigException and after all members are initialized set it to the error message for the particular class.

I will probably look into this myself, if you accept pull requests.

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