ErrnoException.useGlobalErrno

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

class ErrnoException
typeof(this)
useGlobalErrno
(
istring name = ""
,
istring file = __FILE__
,
int line = __LINE__
)

Parameters

name istring

extern function name that is expected to set errno, optional

file istring

file where the exception errno is set

line int

line where the exception errno is set

Return Value

Type: typeof(this)

this instance

Examples

.errno = ENOTBLK;
auto e = new ErrnoException;
test!("==")(
    e.useGlobalErrno("func").append(" str1").append(" str2").message(),
    "func: Block device required str1 str2"[]
);
test!("==")(.errno, ENOTBLK);

Meta