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, string name, string 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, string file, int line)

Calls Func automatically checking errno and storing name

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

Calls enforceRet interpreting return value as error code

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

Calls enforceRet expecting Func to return non-NULL

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

Initializes local reusable error message based on supplied errno value

useGlobalErrno
typeof(this) useGlobalErrno(string name, string 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

Mixed In Members

From mixin ReusableExceptionImplementation!() ReusableImpl

ocean.meta.types.Qualifiers
public import ocean.meta.types.Qualifiers;
Undocumented in source.
ocean.core.Buffer
public import ocean.core.Buffer;
Undocumented in source.
ocean.core.array.Mutation
public static import ocean.core.array.Mutation;
Undocumented in source.
ocean.text.convert.Formatter
public static import ocean.text.convert.Formatter;
Undocumented in source.
ocean.text.convert.Integer_tango
public static import ocean.text.convert.Integer_tango;
Undocumented in source.
reused_msg
Buffer!(char) reused_msg;

Fields used instead of msg for mutable messages. Exception.msg has string type thus can't be overwritten with new data

this
this(size_t size)

Constructs exception object with mutable buffer pre-allocated to length size and other fields kept invalid.

set
typeof(this) set(cstring msg, string file, long line)

Sets exception information for this instance.

enforce
void enforce(T ok, cstring msg, string file, long line)

Throws this instance if ok is false, 0 or null.

message
cstring message()
append
typeof(this) append(cstring msg)

Appends new substring to mutable exception message

append
typeof(this) append(long num, bool hex)

Appends an integer to mutable exception message

fmtAppend
typeof(this) fmtAppend(cstring fmt, Args args)

Appends formatted string

Meta