Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
ErrorModuleHandler Class Reference

The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerModule instances inserted in Init. More...

Private Member Functions

void Init ()
 Gets called shortly after creation of ErrorModuleHandler.
void OnEvent (EventType eventTypeId, Param params)
 is called by DayZGame to pass Events.
void SafeAddModule (notnull ErrorHandlerModule errorModule)
 Wrapper for AddModule to give feedback whether it succeeded or not.
void SafeRemoveModule (ErrorCategory category)
 Wrapper for RemoveModule to give feedback whether it succeeded or not.
void SafeRemoveModule (notnull ErrorHandlerModule errorModule)
 Wrapper for RemoveModule to give feedback whether it succeeded or not.

Static Private Member Functions

static proto bool AddModule (ErrorCategory category, notnull ErrorHandlerModule errorModule)
 Adds a module handler to the ErrorModuleHandler.
static proto int CreateError (ErrorCategory category, int code)
 Creates full error code.
static proto ErrorCategory GetCategoryFromError (int errorCode)
 Returns the category the error was thrown from.
static proto string GetClientMessage (ErrorCategory category, int code, string additionalInfo="")
 Gets the Client Message for specified error.
static proto string GetClientMessageByCode (int errorCode, string additionalInfo="")
 Gets the Client Message for specified error.
static proto int GetCodeFromError (int errorCode)
 Returns the code of the error.
static proto string GetErrorHex (int errorCode)
 Returns a formatted string of the error code.
static proto void GetErrorModules (notnull out array< ErrorHandlerModule > errorModules)
static proto native ErrorModuleHandler GetInstance ()
 Gets the EMH Instance.
static proto string GetLastClientMessage (ErrorCategory category, int code)
 Gets the Client Message for specified error, while attempting to restore information on the most recent error.
static proto string GetLastClientMessageByCode (int errorCode)
 Gets the Client Message for specified error, while attempting to restore information on the most recent error.
static proto string GetLastServerMessage (ErrorCategory category, int code)
 Gets the Server Message for specified error, while attempting to restore information on the most recent error.
static proto string GetLastServerMessageByCode (int errorCode)
 Gets the Server Message for specified error, while attempting to restore information on the most recent error.
static proto string GetServerMessage (ErrorCategory category, int code, string additionalInfo="")
 Gets the Server Message for specified error.
static proto string GetServerMessageByCode (int errorCode, string additionalInfo="")
 Gets the Server Message for specified error.
static proto bool RemoveModule (ErrorCategory category)
 Removes a module handler from the ErrorModuleHandler.
static proto int ThrowError (ErrorCategory category, int code, string additionalInfo="")
 Creates and throws the error code, sending it to the handler of the category.
static proto int ThrowErrorCode (int errorCode, string additionalInfo="")
 Throws the error code and sends it to the handler of the category.

Detailed Description

The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerModule instances inserted in Init.

API comes with several functions to Create, Throw and extract data from error codes. The format used is an int which is made up of two shorts, one that holds the category and one that holds the code. Therefore when looking at an error code, it is much easier to identify when looking at the hex value.

Definition at line 28 of file errormodulehandler.c.

Member Function Documentation

◆ AddModule()

proto bool AddModule ( ErrorCategory category,
notnull ErrorHandlerModule errorModule )
staticprivate

Adds a module handler to the ErrorModuleHandler.

Parameters
categoryErrorCategory Category the module is for
errorModuleErrorHandlerModule The class containing the information and codes for the category.
Returns
bool Whether the adding of the module was successful or not

Referenced by SafeAddModule().

◆ CreateError()

proto int CreateError ( ErrorCategory category,
int code )
staticprivate

Creates full error code.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Returns
int The full error code
int errorCode = ErrorModuleHandler.CreateError( ErrorCategory.ConnectErrorClient, -1 );
Print( errorCode );
>> errorCode = 196607
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto int CreateError(ErrorCategory category, int code)
Creates full error code.
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
proto void Print(void var)
Prints content of variable to console/log.

◆ GetCategoryFromError()

proto ErrorCategory GetCategoryFromError ( int errorCode)
staticprivate

Returns the category the error was thrown from.

Parameters
errorCodeint The full error code
Returns
ErrorCategory The ErrorCategory the error was thrown from
Print( category );
>> category = 2
static proto ErrorCategory GetCategoryFromError(int errorCode)
Returns the category the error was thrown from.

◆ GetClientMessage()

proto string GetClientMessage ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Gets the Client Message for specified error.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Returns
string The message which would appear on Client

Referenced by OnlineServices::ErrorCaught(), and ServerBrowserTab::OnLoadServersAsyncConsole().

◆ GetClientMessageByCode()

proto string GetClientMessageByCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Gets the Client Message for specified error.

Parameters
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Returns
string The message which would appear on Client

◆ GetCodeFromError()

proto int GetCodeFromError ( int errorCode)
staticprivate

Returns the code of the error.

Parameters
errorCodeint The full error code
Returns
int The code of the error
int code = ErrorModuleHandler.GetCodeFromError( 0x0002FFFF );
Print( code );
>> code = -1
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.

Referenced by GetProperties(), and ConnectErrorScriptModuleUI::OnModalResult().

◆ GetErrorHex()

proto string GetErrorHex ( int errorCode)
staticprivate

Returns a formatted string of the error code.

Parameters
errorCodeint The full error code
Returns
string A formatted string of the error code
string formattedCode = ErrorModuleHandler.GetErrorHex( 196607 );
Print( formattedCode );
>> formattedCode = '0x0002FFFF'
static proto string GetErrorHex(int errorCode)
Returns a formatted string of the error code.

Referenced by GetLastClientMessage(), GetLastServerMessage(), GetProperties(), ErrorHandlerModule::GetSimpleMessage(), HandleError(), ErrorHandlerModule::OnErrorThrown(), and OnErrorThrown().

◆ GetErrorModules()

proto void GetErrorModules ( notnull out array< ErrorHandlerModule > errorModules)
staticprivate

Referenced by OnEvent().

◆ GetInstance()

proto native ErrorModuleHandler GetInstance ( )
staticprivate

Gets the EMH Instance.

Returns
ErrorModuleHandler The ErrorModuleHandler Instance

Referenced by CGame::OnEvent(), and EnProfilerTests::TestFuncCountData().

◆ GetLastClientMessage()

proto string GetLastClientMessage ( ErrorCategory category,
int code )
staticprivate

Gets the Client Message for specified error, while attempting to restore information on the most recent error.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Returns
string The message which would appear on Client

◆ GetLastClientMessageByCode()

proto string GetLastClientMessageByCode ( int errorCode)
staticprivate

Gets the Client Message for specified error, while attempting to restore information on the most recent error.

Parameters
errorCodeint The full error code
Returns
string The message which would appear on Client

◆ GetLastServerMessage()

proto string GetLastServerMessage ( ErrorCategory category,
int code )
staticprivate

Gets the Server Message for specified error, while attempting to restore information on the most recent error.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Returns
string The message which would appear on Server

◆ GetLastServerMessageByCode()

proto string GetLastServerMessageByCode ( int errorCode)
staticprivate

Gets the Server Message for specified error, while attempting to restore information on the most recent error.

Parameters
errorCodeint The full error code
Returns
string The message which would appear on Server

◆ GetServerMessage()

proto string GetServerMessage ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Gets the Server Message for specified error.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Returns
string The message which would appear on Server

◆ GetServerMessageByCode()

proto string GetServerMessageByCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Gets the Server Message for specified error.

Parameters
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Returns
string The message which would appear on Server

◆ Init()

void Init ( )
inlineprivate

Gets called shortly after creation of ErrorModuleHandler.

Definition at line 240 of file errormodulehandler.c.

References ConnectErrorScriptModule(), g_Game, and SafeAddModule().

◆ OnEvent()

void OnEvent ( EventType eventTypeId,
Param params )
inlineprivate

is called by DayZGame to pass Events.

Definition at line 255 of file errormodulehandler.c.

References GetErrorModules().

Referenced by CGame::OnEvent().

◆ RemoveModule()

proto bool RemoveModule ( ErrorCategory category)
staticprivate

Removes a module handler from the ErrorModuleHandler.

Parameters
categoryErrorCategory Category the module is for
Returns
bool Whether the removing of the module was successful or not

Referenced by SafeRemoveModule(), and SafeRemoveModule().

◆ SafeAddModule()

void SafeAddModule ( notnull ErrorHandlerModule errorModule)
inlineprivate

Wrapper for AddModule to give feedback whether it succeeded or not.

Parameters
errorModuleErrorHandlerModule The ErrorHandlerModule to add

Definition at line 211 of file errormodulehandler.c.

References AddModule(), and Error().

Referenced by Init().

◆ SafeRemoveModule() [1/2]

void SafeRemoveModule ( ErrorCategory category)
inlineprivate

Wrapper for RemoveModule to give feedback whether it succeeded or not.

Parameters
categoryErrorCategory Category to remove

Definition at line 231 of file errormodulehandler.c.

References Error(), and RemoveModule().

◆ SafeRemoveModule() [2/2]

void SafeRemoveModule ( notnull ErrorHandlerModule errorModule)
inlineprivate

Wrapper for RemoveModule to give feedback whether it succeeded or not.

Parameters
errorModuleErrorHandlerModule The ErrorHandlerModule to add

Definition at line 221 of file errormodulehandler.c.

References Error(), and RemoveModule().

◆ ThrowError()

proto int ThrowError ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Creates and throws the error code, sending it to the handler of the category.

Parameters
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Returns
int The full error code
int errorCode = ErrorModuleHandler.ThrowError( ErrorCategory.ConnectErrorClient, -1 );
Print( errorCode );
>> errorCode = 196607
static proto int ThrowError(ErrorCategory category, int code, string additionalInfo="")
Creates and throws the error code, sending it to the handler of the category.

Referenced by CGame::TryConnect().

◆ ThrowErrorCode()

proto int ThrowErrorCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Throws the error code and sends it to the handler of the category.

Parameters
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Returns
int The full error code
int errorCode = ErrorModuleHandler.ThrowErrorCode( 0x0002FFFF );
Print( errorCode );
>> errorCode = 196607
static proto int ThrowErrorCode(int errorCode, string additionalInfo="")
Throws the error code and sends it to the handler of the category.

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