Boost.Test > Components > The Execution Monitor > boost::execution_exception
Boost Test logo


The boost::execution exception is an exception used by the Execution Monitor to report problems detected during controlled function run. It intentionally does not allocate any memory to be safe to use in case of lack of memory.

class execution_exception {
    enum error_code {
        cpp_exception_error,    // see note (1) below
        user_error,             // user reported nonfatal error
        system_error,           // see note (2) below
        timeout_error,          // only detectable on certain platforms
        user_fatal_error,       // user reported fatal error
        system_fatal_error      // see note (2) below

    error_code code() const;    // use this method to get an error code for the exception
    char const* what() const;   // use this method to get an error message for the exception

Note 1: Only uncaught C++ exceptions are treated as errors. If the application catches a C++ exception, it will never reach the boost::execution_monitor.

Note 2: These errors include UNIX signals and Windows structured exceptions. They are often initiated by hardware traps.

The implementation decides what is a fatal_system_exception and what is just a system_exception. Fatal errors are so likely to have corrupted machine state (like a stack overflow or addressing exception) that it is unreasonable to continue execution.