BDE 4.14.0 Production release
|
#include <bslstl_stdexceptutil.h>
Public Types | |
typedef void(* | PreThrowHook) (const char *exceptionName, const char *message) |
Static Public Member Functions | |
static void | logCheapStackTrace (const char *exceptionName, const char *message) |
static void | setRuntimeErrorHook (PreThrowHook hook) |
static void | setLogicErrorHook (PreThrowHook hook) |
static void | setDomainErrorHook (PreThrowHook hook) |
static void | setInvalidArgumentHook (PreThrowHook hook) |
static void | setLengthErrorHook (PreThrowHook hook) |
static void | setOutOfRangeHook (PreThrowHook hook) |
static void | setRangeErrorHook (PreThrowHook hook) |
static void | setOverflowErrorHook (PreThrowHook hook) |
static void | setUnderflowErrorHook (PreThrowHook hook) |
static BSLA_NORETURN void | throwRuntimeError (const char *message) |
static BSLA_NORETURN void | throwLogicError (const char *message) |
static BSLA_NORETURN void | throwDomainError (const char *message) |
static BSLA_NORETURN void | throwInvalidArgument (const char *message) |
static BSLA_NORETURN void | throwLengthError (const char *message) |
static BSLA_NORETURN void | throwOutOfRange (const char *message) |
static BSLA_NORETURN void | throwRangeError (const char *message) |
static BSLA_NORETURN void | throwOverflowError (const char *message) |
static BSLA_NORETURN void | throwUnderflowError (const char *message) |
This struct
provides a namespace for static
utility functions that throw standard library exceptions.
typedef void(* bslstl::StdExceptUtil::PreThrowHook) (const char *exceptionName, const char *message) |
This is the type of function pointer that can be set. One such static function pointer exists for each exception type supported by this component. Functions called to throw exceptions examine their respective pointer, and if it's non-null, call it and then throw after it returns. Note that it is recommended that the hook function log a greppable statement such as "About to throw <exceptionName>".
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Log "About to throw ", then the specified exceptionName
, then the specified message
, then log a cheap stack trace with warning severity. This function is intended as a candidate for setting to the pre-throw hooks. Note that a far slower alternative to this, which logs a full, multi-line stack trace with resolved symbols and, on many platforms, line numbers and source file names, is balst::StackTracePrintUtil::logExceptionStackTrace
.
|
static |
|
static |
|
static |
Set the pre throw hook for the specified exception type to the specified hook
. If hook
is passed 0, or if the settor was never called, that means that no pre-throw function will be called.
|
static |
Throw a std::domain_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::invalid_argument
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::length_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::logic_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::out_of_range
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::overflow_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::range_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::runtime_error
exception supplying the specified message
as the sole argument to its constructor.
|
static |
Throw a std::underflow_error
exception supplying the specified message
as the sole argument to its constructor.