Closed dixx closed 5 years ago
Seems we may use exit codes -1 < code < 256
, where 0
means success
and all other mean failure
.
We cannot exit()
far away from main
, as no stack unwinding will happen then --> memory leaks.
So either we unwind from hand, or via exception caught in main
, which is a bad thing to do.
Good read about exceptions: https://isocpp.org/wiki/faq/exceptions http://www.modernescpp.com/index.php/c-core-guidelines-rules-to-error-handling https://docs.microsoft.com/en-us/cpp/cpp/how-to-design-for-exception-safety?view=vs-2017 https://dzone.com/articles/some-useful-facts-to-know-when-using-c-exceptions
Blocker: #111
Not only do we need to log errors, we also need to set an errorlevel / exit code. May be done via Logger or an extra class.
Goal: Use default objects where feasible, catch exceptions where they can be handled, log every exceptional behavior, and always shut down gracefully.