|
CBMC
|
Base class for exceptions thrown in the cprover project. More...
#include <c_errors.h>
Public Member Functions | |
| virtual std::string | what () const |
| A human readable description of what went wrong. | |
| virtual | ~cprover_exception_baset ()=default |
| virtual std::string | what () const |
| A human readable description of what went wrong. | |
| virtual | ~cprover_exception_baset ()=default |
| cprover_exception_baset ()=default | |
| cprover_exception_baset (cprover_exception_baset &&)=default | |
| cprover_exception_baset (const cprover_exception_baset &src) | |
| std::string | reason () const |
Protected Member Functions | |
| cprover_exception_baset (std::string reason) | |
| This constructor is marked protected to ensure this class isn't used directly. | |
| cprover_exception_baset (std::string reason) | |
| This constructor is marked protected to ensure this class isn't used directly. | |
Protected Attributes | |
| std::string | reason |
| The reason this exception was generated. | |
| std::ostringstream | _reason |
| The reason this exception was generated. | |
Friends | |
| template<typename E, typename T> | |
| std::enable_if_t< std::is_base_of< cprover_exception_baset, std::decay_t< E > >::value, E && > | operator<< (E &&e, const T &message) |
| add to the diagnostic information in the given cprover_exception_baset exception; the type of the exception is preserved, enabling throw some_exceptiont{...} << "text" | |
Base class for exceptions thrown in the cprover project.
Intended to be used as a convenient way to have a "catch all and report errors" from application entry points. Note that the reason we use a custom base class as opposed to std::exception or one of its derivates to avoid them being accidentally caught by code expecting standard exceptions to be only thrown by the standard library.
Definition at line 63 of file c_errors.h.
|
virtualdefault |
|
inlineexplicitprotected |
This constructor is marked protected to ensure this class isn't used directly.
Deriving classes should be used to more precisely describe the problem that occurred.
Definition at line 76 of file c_errors.h.
|
virtualdefault |
|
default |
|
default |
|
inline |
Definition at line 41 of file exception_utils.h.
|
inlineexplicitprotected |
This constructor is marked protected to ensure this class isn't used directly.
Deriving classes should be used to more precisely describe the problem that occurred.
Definition at line 55 of file exception_utils.h.
|
inline |
Definition at line 46 of file exception_utils.h.
|
virtual |
A human readable description of what went wrong.
For readability, implementors should not add a leading or trailing newline to this description.
Reimplemented in incorrect_goto_program_exceptiont, invalid_command_line_argument_exceptiont, invalid_function_contract_pair_exceptiont, invalid_restriction_exceptiont, and invalid_source_file_exceptiont.
Definition at line 12 of file exception_utils.cpp.
|
virtual |
A human readable description of what went wrong.
For readability, implementors should not add a leading or trailing newline to this description.
Reimplemented in incorrect_goto_program_exceptiont, invalid_command_line_argument_exceptiont, invalid_function_contract_pair_exceptiont, invalid_restriction_exceptiont, and invalid_source_file_exceptiont.
|
friend |
add to the diagnostic information in the given cprover_exception_baset exception; the type of the exception is preserved, enabling throw some_exceptiont{...} << "text"
Definition at line 1 of file exception_utils.h.
|
protected |
The reason this exception was generated.
This is the string returned by what() unless that method is overridden. This is an ostringstream to enable efficient appending with <<.
Definition at line 64 of file exception_utils.h.
|
protected |
The reason this exception was generated.
This is the string returned by what() unless that method is overridden
Definition at line 83 of file c_errors.h.