class ErrorModuleHandlerSource
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.
Methods 23
static proto int ThrowError(ErrorCategory category, int code, string additionalInfo = "")Creates and throws the error code, sending it to the handler of the category.
categoryErrorCategoryCategory the error is thrown fromcodeintThe code that the error belongs to inside the category between [-32768, 32767]additionalInfostringAny additional info regarding the error, usually data
Returns: int The full error code
int errorCode = ErrorModuleHandler.ThrowError( ErrorCategory.ConnectErrorClient, -1 );
Print( errorCode );
>> errorCode = 196607Throws the error code and sends it to the handler of the category.
errorCodeintThe full error codeadditionalInfostringAny additional info regarding the error, usually data
Returns: int The full error code
int errorCode = ErrorModuleHandler.ThrowErrorCode( 0x0002FFFF );
Print( errorCode );
>> errorCode = 196607static proto int CreateError(ErrorCategory category, int code)Creates full error code.
categoryErrorCategoryCategory the error is thrown fromcodeintThe 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 = 196607static proto ErrorCategory GetCategoryFromError(int errorCode)Returns the category the error was thrown from.
errorCodeintThe full error code
Returns: ErrorCategory The ErrorCategory the error was thrown from
ErrorCategory category = ErrorModuleHandler.GetCategoryFromError( 0x0002FFFF );
Print( category );
>> category = 2Returns the code of the error.
errorCodeintThe full error code
Returns: int The code of the error
int code = ErrorModuleHandler.GetCodeFromError( 0x0002FFFF );
Print( code );
>> code = -1Returns a formatted string of the error code.
errorCodeintThe full error code
Returns: string A formatted string of the error code
string formattedCode = ErrorModuleHandler.GetErrorHex( 196607 );
Print( formattedCode );
>> formattedCode = '0x0002FFFF'static proto bool AddModule(ErrorCategory category, notnull ErrorHandlerModule errorModule)Adds a module handler to the ErrorModuleHandler.
categoryErrorCategoryCategory the module is forerrorModuleErrorHandlerModuleThe class containing the information and codes for the category.
Returns: bool Whether the adding of the module was successful or not
static proto bool RemoveModule(ErrorCategory category)Removes a module handler from the ErrorModuleHandler.
categoryErrorCategoryCategory the module is for
Returns: bool Whether the removing of the module was successful or not
static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo = "")Gets the Client Message for specified error
categoryErrorCategoryCategory the error is thrown fromcodeintThe code that the error belongs to inside the category between [-32768, 32767]additionalInfostringAny additional info regarding the error, usually data
Returns: string The message which would appear on Client
Gets the Client Message for specified error
errorCodeintThe full error codeadditionalInfostringAny additional info regarding the error, usually data
Returns: string The message which would appear on Client
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
categoryErrorCategoryCategory the error is thrown fromcodeintThe code that the error belongs to inside the category between [-32768, 32767]
Returns: string The message which would appear on Client
Gets the Client Message for specified error, while attempting to restore information on the most recent error
errorCodeintThe full error code
Returns: string The message which would appear on Client
static proto string GetServerMessage(ErrorCategory category, int code, string additionalInfo = "")Gets the Server Message for specified error
categoryErrorCategoryCategory the error is thrown fromcodeintThe code that the error belongs to inside the category between [-32768, 32767]additionalInfostringAny additional info regarding the error, usually data
Returns: string The message which would appear on Server
Gets the Server Message for specified error
errorCodeintThe full error codeadditionalInfostringAny additional info regarding the error, usually data
Returns: string The message which would appear on Server
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
categoryErrorCategoryCategory the error is thrown fromcodeintThe code that the error belongs to inside the category between [-32768, 32767]
Returns: string The message which would appear on Server
Gets the Server Message for specified error, while attempting to restore information on the most recent error
errorCodeintThe full error code
Returns: string The message which would appear on Server
static proto native ErrorModuleHandler GetInstance()Gets the EMH Instance
Returns: ErrorModuleHandler The ErrorModuleHandler Instance
static proto void GetErrorModules(notnull out array<ErrorHandlerModule> errorModules)void SafeAddModule(notnull ErrorHandlerModule errorModule)Wrapper for AddModule to give feedback whether it succeeded or not.
errorModuleErrorHandlerModuleThe ErrorHandlerModule to add
void SafeRemoveModule(notnull ErrorHandlerModule errorModule)Wrapper for RemoveModule to give feedback whether it succeeded or not.
errorModuleErrorHandlerModuleThe ErrorHandlerModule to add
void SafeRemoveModule(ErrorCategory category)Wrapper for RemoveModule to give feedback whether it succeeded or not.
categoryErrorCategoryCategory to remove
private void Init()Gets called shortly after creation of ErrorModuleHandler.
is called by DayZGame to pass Events.