#include <bslstl_stdexceptutil.h>
This struct provides a namespace for static utility functions that throw standard library exceptions.
See bslstl_stdexceptutil
|
| typedef void(* | PreThrowHook) (const char *exceptionName, const char *message) |
| |
◆ PreThrowHook
| 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
- Note that it is recommended that the hook function log a greppable statement such as "About to throw
<exceptionName>".
◆ logCheapStackTrace()
| static void bslstl::StdExceptUtil::logCheapStackTrace |
( |
const char * |
exceptionName, |
|
|
const char * |
message |
|
) |
| |
|
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
- 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.
◆ setDomainErrorHook()
| static void bslstl::StdExceptUtil::setDomainErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setInvalidArgumentHook()
| static void bslstl::StdExceptUtil::setInvalidArgumentHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setLengthErrorHook()
| static void bslstl::StdExceptUtil::setLengthErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setLogicErrorHook()
| static void bslstl::StdExceptUtil::setLogicErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setOutOfRangeHook()
| static void bslstl::StdExceptUtil::setOutOfRangeHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setOverflowErrorHook()
| static void bslstl::StdExceptUtil::setOverflowErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setRangeErrorHook()
| static void bslstl::StdExceptUtil::setRangeErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setRuntimeErrorHook()
| static void bslstl::StdExceptUtil::setRuntimeErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
static |
◆ setUnderflowErrorHook()
| static void bslstl::StdExceptUtil::setUnderflowErrorHook |
( |
PreThrowHook |
hook | ) |
|
|
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.
◆ throwDomainError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwDomainError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::domain_error exception supplying the specified message as the sole argument to its constructor.
◆ throwInvalidArgument()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwInvalidArgument |
( |
const char * |
message | ) |
|
|
static |
Throw a std::invalid_argument exception supplying the specified message as the sole argument to its constructor.
◆ throwLengthError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwLengthError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::length_error exception supplying the specified message as the sole argument to its constructor.
◆ throwLogicError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwLogicError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::logic_error exception supplying the specified message as the sole argument to its constructor.
◆ throwOutOfRange()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwOutOfRange |
( |
const char * |
message | ) |
|
|
static |
Throw a std::out_of_range exception supplying the specified message as the sole argument to its constructor.
◆ throwOverflowError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwOverflowError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::overflow_error exception supplying the specified message as the sole argument to its constructor.
◆ throwRangeError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwRangeError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::range_error exception supplying the specified message as the sole argument to its constructor.
◆ throwRuntimeError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwRuntimeError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::runtime_error exception supplying the specified message as the sole argument to its constructor.
◆ throwUnderflowError()
| static BSLA_NORETURN void bslstl::StdExceptUtil::throwUnderflowError |
( |
const char * |
message | ) |
|
|
static |
Throw a std::underflow_error exception supplying the specified message as the sole argument to its constructor.
The documentation for this struct was generated from the following file: