Move towards exceptions for "hard failure" scenarios (was ACTSFW-77)
Original author Hadrien Benjamin Grasland @hgraslan.
Error handling based on status codes has a number of problems. It obscures the cause of error unless special precautions are taken during reporting (cf ACTSFW-66), it forces use of a clunky and fragile two-stage initialization and finalization mechanism (cf ACTSFW-68), it obscures the purpose of functions by eating up useful return values (cf ACTSFW-56), and it requires clumsy explicit handlers at every level of the call chain.
While status codes have some advantages for error recovery (for example, if used well, they can clarify what kind of errors may occur), we do not really need this at the moment as most of our errors are unrecoverable. So we decided at the last meeting to move towards exceptions-based error reporting for all unrecoverable error scenarios, which should encompass most of the existing usage of status codes.
As a first step, we will simply use one of the standard subclasses of std::exception with an appropriate error message, which will basically give us the error reporting functionality that we already have plus backtraces in debuggers. Later on, we may introduce more specific exception types that inherit from std::exception if the need arises.