ErrnoException.useGlobalErrno

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

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

Parameters

name string

extern function name that is expected to set errno, optional

file string

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