Error Facilities

Overview

This section describes types and facilities for setting and retrieving error information. More…

// structs

struct std.Error;

// global variables

std.Guid std.g_errnoGuid = { 0x25a6a7b5, 0xf662, 0x48ae, { 0xbc, 0xb6, 0x9a, 0x5c, 0xb5, 0xce, 0x5b, 0xb9 } };
std.Guid std.g_winErrorGuid = { 0x54e100e8, 0x2137, 0x40b8, { 0xbc, 0xd8, 0x00, 0xac, 0x1d, 0x0b, 0xaa, 0x16 } };
std.Guid std.g_ntStatusGuid = { 0x81443347, 0x3bc9, 0x4d5e, { 0x8b, 0x23, 0x32, 0xd7, 0x80, 0xed, 0xb5, 0x2b } };

// global functions

std.Error const* std.getLastError();
string_t std.getLastErrorDescription();
void std.setError(std.Error const* error);
void std.setErrno(int errno);
void std.setError(string_t string);

Detailed Documentation

This section describes types and facilities for setting and retrieving error information.

Global Functions

std.Error const* std.getLastError()

Returns a pointer to the last error set in the context of the current thread.

Currently this function allocates a new error buffer on every call. In the future caching will be implemented(if AXL error has not changed since the last invokation of getLastError then previously allocated error buffer could be re-used).

string_t std.getLastErrorDescription()

Returns a human readable description of the the last error set in the context of the current thread.

Equivalent to:

std.getLastError().m_description
void std.setError(std.Error const* error)

Sets the last error of the current thread.

void std.setErrno(int errno)

Sets errno error as the last error of the current thread.

void std.setError(string_t string)

Sets string error described by a null-terminated string pointed to by string as the last error of the current thread.

Calling std.Error.m_description on a string error will yield a null-terminated string identical to string.