Requirements
- Exceptions should be compatible to std::exceptions
- Exceptions should be lightweight and easy to use
- It must be possible to add information to an exception when throwing
- It must be possible to add information to already thrown exceptions (rethrow)
- It must be possible to throw and catch exceptions over thread borders
Design-Decisions:
- std::exceptions are used as a base class for our Exceptions because this allows (1).
- We only enhance our Exceptions to allow them to contain more information than a single char array. This satisfies (2) as well as (3) and (4).
- We provide two macros MIRA_THROW and MIRA_RETHROW. This makes it easy to throw and re-throw exceptions and to add information to the exception via streams (2),(3),(4).
- The interface of our exceptions is stable and allows future extensions for throwing exceptions over thread borders to achieve (5).