In utils/wp_exceptions.hpp, we already introduce some wavepacket-specific exceptions. However, some exceptions and exception use cases are missing, so at several places we resort to exceptions from the standard library.
The goal of this issue is to design a wavepacket-specific exception hierarchy. All wavepacket code should only throw wavepacket exceptions, hence adaption of the code is also required. Look at what is thrown and add the missing exceptions.
Unsorted thoughts relevant to this issue:
- InvalidValueException is complicated to use. This could be avoided by having an easy way to format strings in printf style and just printing the problematic value. boost has such a formatting library, how heavy is it?
- We lack various exceptions
- time-dependent operator where a time-independent one is required
- incorrect grid type
- invalid arguments (!= InvalidValueException), e.g., a list with the wrong number of elements
- Exception for numerical errors, when the output is invalid
- general procedure errors when something in a complex factory/ class goes wrong or so.
- Exceptions that are triggered by other exceptions should generally throw the original cause with the new exception. That would make debugging way easier.
Diff:
Diff:
Diff:
Diff:
BadGridException has been fixed in passing in [#121]
Related
Tickets:
#121Diff: