Review of Error Handling Frameworks
Outcome started life in 2014, entered Boost as Boost.Outcome in 2018, and therefore was amongst the very first of the major alternative error handling frameworks to standard exception throws in C++. Since then, and sometimes in reaction to Outcome’s choice of design, alternative frameworks have appeared. This page tries to give a fairly even handed summary of those alternatives, and how they compare to Outcome in this author’s opinion.
These are listed in order of approximate availability to the C++ ecosystem i.e. in order of appearance.
-
std exception throws
Advantages and disadvantages of C++ exception throws
-
std error codes
Advantages and disadvantages of
std::error_code
-
std expected
Advantages and disadvantages of
std::expected<T, E>
-
Outcome (proposed std result)
Advantages and disadvantages of Outcome and its proposed
std::result<T>
-
LEAF
Advantages and disadvantages of Lightweight Error Augmentation Framework
My thanks to Emil Dotchevski for reviewing this summary and providing notes.