|
WPILibC++
2020.3.2
|
Helper for check-and-exit error handling. More...
#include <Error.h>
Public Member Functions | |
| ExitOnError (std::string Banner="", int DefaultErrorExitCode=1) | |
| Create an error on exit helper. | |
| void | setBanner (std::string Banner) |
| Set the banner string for any errors caught by operator(). | |
| void | setExitCodeMapper (std::function< int(const Error &)> GetExitCode) |
| Set the exit-code mapper function. | |
| void | operator() (Error Err) const |
| Check Err. If it's in a failure state log the error(s) and exit. | |
| template<typename T > | |
| T | operator() (Expected< T > &&E) const |
| Check E. More... | |
| template<typename T > | |
| T & | operator() (Expected< T & > &&E) const |
| Check E. More... | |
Helper for check-and-exit error handling.
For tool use only. NOT FOR USE IN LIBRARY CODE.
|
inline |
Check E.
If it's in a success state then return the contained reference. If it's in a failure state log the error(s) and exit.
|
inline |
Check E.
If it's in a success state then return the contained value. If it's in a failure state log the error(s) and exit.