Struct SystemErrorCode

A tagged union that holds an error code from system apis, meaning one from Windows GetLastError() or C's errno.

struct SystemErrorCode;

You construct it with SystemErrorCode(thing) and the overloaded constructor tags and stores it.

Constructors

NameDescription
this (errno) C/unix error are typed as signed ints... Windows' errors are typed DWORD, aka unsigned...

Fields

NameTypeDescription
code const(int)You should technically cast it back to DWORD if it is a win32 code
type const(SystemErrorCode.Type)

Methods

NameDescription
codeAsString () The numeric code itself as a string.
errorString () A text explanation of the code. See [codeAsString] for a string representation of the numeric representation.
toString () Constructs a string containing both the code and the explanation string.
wasSuccessful () Returns if the code indicated success.

Enums

NameDescription
Type