Skip to content

Throw exceptions for invalid user input

Vicentini Filippo requested to merge github/fork/femtobit/error-handling into master

Created by: femtobit

This pull request adds a custom exception class and replaces all calls to std::abort for invalid user input with throwing this exception.

This makes the code easier to read in most parts and allows us to handle invalid input in a single place (currently in main by printing an error message and exiting).

This PR also adds a point to the list of exceptions from the Google C++ Guide in CONTRIBUTING.md because the Google guide does not permit the use of exceptions (for reasons that in my opinion do not apply to netket).

Merge request reports