Normalize exception handling
-
Revise all throwstatements in code. Can the exception be replaced by a regular return value? If not, use specific exceptions for certain conditions, e.g. std::invalid_argument for invalid function arguments. Consider subtyping std::exception or std::runtime_error for other use cases. Let a failed assertion throw a new subtype of std::logic_error. -
Review all catchstatements in code. If they are meant to catch specific exceptions, then only catch that exception type, or provide an additional, more generic catch statement that catches and rethrows all other types of exceptions. -
For certain exceptions, in addition to writing a message to the GUI message frame, also launch a QMessageBox. -
Currently, exceptions are lost if they are thrown inside event handling code (e.g. inside JobListView::onRun). Either mark slots as nothrow, or provide them with standardized try-catch blocks.
Edited by Joachim Wuttke