BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::StdExceptUtil Struct Reference

#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)
 

Detailed Description

This struct provides a namespace for static utility functions that throw standard library exceptions.

Member Typedef Documentation

◆ 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 that it is recommended that the hook function log a greppable statement such as "About to throw <exceptionName>".

Member Function Documentation

◆ logCheapStackTrace()

static void bslstl::StdExceptUtil::logCheapStackTrace ( const char *  exceptionName,
const char *  message 
)
static

◆ 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

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.

◆ 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: