ErrnoException

Exception class which reads, stores and resets the thread-local errno

Members

Functions

addMessage
typeof(this) addMessage(cstring msg)

Convenience method to append extra message in brackets

enforce
void enforce(bool expr, cstring msg, istring name, istring file, int line)

Tries to evaluate expr. If it fails, checks the global errno and uses matching message as base for exception message, as well as throws the exception.

enforceRet
Caller!(typeof(&Func)) enforceRet(bool function(ReturnTypeOf!(Func)) verify, istring file, int line)

Calls Func automatically checking errno and storing name

enforceRetCode
Caller!(typeof(&Func)) enforceRetCode(istring file, int line)

Calls enforceRet interpreting return value as error code

enforceRetPtr
Caller!(typeof(&Func)) enforceRetPtr(istring file, int line)

Calls enforceRet expecting Func to return non-NULL

errorNumber
int errorNumber()
failedFunctionName
istring failedFunctionName()
set
typeof(this) set(int err_num, istring name, istring file, int line)

Initializes local reusable error message based on supplied errno value

useGlobalErrno
typeof(this) useGlobalErrno(istring name, istring file, int line)

Initializes local reusable error message based on global errno value and resets errno to 0.

Mixins

ReusableImpl
mixin ReusableExceptionImplementation!() ReusableImpl

Provides standard reusable exception API

Meta