Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::Error Class Reference

Core class that represents an error. More...

Static Public Member Functions

static UInt32 GetFlags ()
 Gets the flags of the error. More...
 
static String GetLastError (const char **file=nullptr, unsigned int *line=nullptr, const char **function=nullptr)
 Gets the last error. More...
 
static unsigned int GetLastSystemErrorCode ()
 Gets the last system error code. More...
 
static String GetLastSystemError (unsigned int code=GetLastSystemErrorCode())
 Gets the string representation of the last system error code. More...
 
static void SetFlags (UInt32 flags)
 Sets the flags. More...
 
static void Trigger (ErrorType type, const String &error)
 Checks if the error should trigger. More...
 
static void Trigger (ErrorType type, const String &error, unsigned int line, const char *file, const char *function)
 Checks if the error should trigger. More...
 

Detailed Description

Core class that represents an error.

Member Function Documentation

◆ GetFlags()

UInt32 Nz::Error::GetFlags ( )
static

Gets the flags of the error.

Returns
Flag

◆ GetLastError()

String Nz::Error::GetLastError ( const char **  file = nullptr,
unsigned int *  line = nullptr,
const char **  function = nullptr 
)
static

Gets the last error.

Returns
Last error
Parameters
fileOptional argument to set last error file
lineOptional argument to set last error line
functionOptional argument to set last error function

◆ GetLastSystemError()

String Nz::Error::GetLastSystemError ( unsigned int  code = GetLastSystemErrorCode())
static

Gets the string representation of the last system error code.

Returns
Message of the error
Parameters
codeCode of the error

◆ GetLastSystemErrorCode()

unsigned int Nz::Error::GetLastSystemErrorCode ( )
static

Gets the last system error code.

Returns
"errno"

◆ SetFlags()

void Nz::Error::SetFlags ( UInt32  flags)
static

Sets the flags.

Parameters
flagsFlags for the error

◆ Trigger() [1/2]

void Nz::Error::Trigger ( ErrorType  type,
const String error 
)
static

Checks if the error should trigger.

Parameters
typeErrorType of the error
errorMessage of the error
Remarks
Produces a std::abort on AssertFailed with NAZARA_CORE_EXIT_ON_ASSERT_FAILURE defined
Produces a std::runtime_error on AssertFailed or throwing exception

◆ Trigger() [2/2]

void Nz::Error::Trigger ( ErrorType  type,
const String error,
unsigned int  line,
const char *  file,
const char *  function 
)
static

Checks if the error should trigger.

Parameters
typeErrorType of the error
errorMessage of the error
lineLine of the error
fileFile of the error
functionFunction of the error
Remarks
Produces a std::abort on AssertFailed with NAZARA_CORE_EXIT_ON_ASSERT_FAILURE defined
Produces a std::runtime_error on AssertFailed or throwing exception

The documentation for this class was generated from the following files: