FileException

Exception class that checks error status on both file descriptor and via global errno

Members

Aliases

enforce
alias enforce = ErrnoException.enforce

Make ErrnoException's enforce available

Functions

enforce
void enforce(bool ok, cstring filename, FILE* handle, istring file, int line)

Enforces success of file I/O operation

Inherited Members

From ErrnoException

ReusableImpl
mixin ReusableExceptionImplementation!() ReusableImpl

Provides standard reusable exception API

errorNumber
int errorNumber()
failedFunctionName
istring failedFunctionName()
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

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

Calls enforceRet expecting Func to return non-NULL

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

Calls enforceRet interpreting return value as error code

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.

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

Initializes local reusable error message based on supplied errno value

addMessage
typeof(this) addMessage(cstring msg)

Convenience method to append extra message in brackets

Meta