Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
errorhandlermodule.c File Reference

Go to the source code of this file.

Data Structures

class  ErrorHandlerModule
 Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not moddable) More...
 

Functions

void ErrorHandlerModuleScript ()
 Constructor, by default calls the function that will fill the ErrorDataMap. More...
 
void ~ErrorHandlerModuleScript ()
 
void InitOptionalVariables ()
 Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorProperties are created. More...
 
void FillErrorDataMap ()
 Function to fill up m_ErrorDataMap, gets called in the Constructor. More...
 
ErrorProperties GetProperties (int errorCode)
 Fetches the ErrorProperties for the error code. More...
 
override string GetClientMessage (int errorCode, string additionalInfo="")
 Fetches the Client message for the error code. More...
 
override string GetLastClientMessage (int errorCode)
 Fetches the Client message for the error code, attempting to retrieve the data from the latest. More...
 
override string GetServerMessage (int errorCode, string additionalInfo="")
 Fetches the Server message for the error code. More...
 
override string GetLastServerMessage (int errorCode)
 Fetches the Server message for the error code, attempting to retrieve the data from the latest. More...
 
protected override void OnErrorThrown (int errorCode, owned string additionalInfo="")
 Event that gets triggered when an error of the owned category is thrown. Do not call directly! Call ErrorModuleHandler.ThrowError instead. More...
 
void InsertDialogueErrorProperties (int code, string message, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling, using the Optional Variables. More...
 
void InsertHeaderDialogueErrorProperties (int code, string message, string header, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with custom header. More...
 
void InsertPrefixDialogueErrorProperties (int code, string message, string prefix, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with custom prefix. More...
 
void InsertExtendedPrefixDialogueErrorProperties (int code, string message, string prefix, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with extended prefix. More...
 
void InsertExtendedPrefixSplitDialogueErrorProperties (int code, string message, string prefix, string serverMessage, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with extended prefix and separate server message. More...
 
void InsertSplitDialogueErrorProperties (int code, string message, string serverMessage, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with separate server message. More...
 
void InsertErrorProperties (int code, string message="")
 Insert an error with no handling. More...
 

Variables

class ErrorHandlerModule m_Header = ""
 This is where to input logic and extend functionality of ErrorHandlerModule. More...
 
protected string m_Prefix = ""
 Optional: Prefix (e.g. Fixed text at the start of the messages in the module) More...
 
protected ref UIScriptedMenu m_UIHandler = null
 Optional: The UI the handler might generally use More...
 
protected int m_LastErrorThrown = 0
 Holds the last thrown error in this module, defaults to 0. More...
 
protected string m_LastAdditionalInfo = ""
 Holds the last additional info passed in. More...
 
protected ref map< int, ref ErrorPropertiesm_ErrorDataMap = new map<int, ref ErrorProperties>()
 Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This contains at the very least the Message for the error Additionally, it can contain the way to handle the error (e.g. Throw a Dialogue with the message) More...
 

Function Documentation

◆ ErrorHandlerModuleScript()

void ErrorHandlerModuleScript ( )

Constructor, by default calls the function that will fill the ErrorDataMap.

Definition at line 81 of file errorhandlermodule.c.

◆ FillErrorDataMap()

void FillErrorDataMap ( )

Function to fill up m_ErrorDataMap, gets called in the Constructor.

Already insert the default "UNKNOWN ERROR" message for code "-1"

Definition at line 101 of file errorhandlermodule.c.

◆ GetClientMessage()

override string GetClientMessage ( int  errorCode,
string  additionalInfo = "" 
)

Fetches the Client message for the error code.

Parameters
errorCodeint The full error code
Returns
string The Client message for the error

Definition at line 130 of file errorhandlermodule.c.

◆ GetLastClientMessage()

override string GetLastClientMessage ( int  errorCode)

Fetches the Client message for the error code, attempting to retrieve the data from the latest.

Parameters
errorCodeint The full error code to check against
Returns
string The Client message for the error

Definition at line 149 of file errorhandlermodule.c.

◆ GetLastServerMessage()

override string GetLastServerMessage ( int  errorCode)

Fetches the Server message for the error code, attempting to retrieve the data from the latest.

Parameters
errorCodeint The full error code to check against
Returns
string The Server message for the error

Definition at line 186 of file errorhandlermodule.c.

◆ GetProperties()

ErrorProperties GetProperties ( int  errorCode)

Fetches the ErrorProperties for the error code.

Parameters
errorCodeint The full error code
Returns
ErrorProperties The data and handling for the error

Definition at line 112 of file errorhandlermodule.c.

◆ GetServerMessage()

override string GetServerMessage ( int  errorCode,
string  additionalInfo = "" 
)

Fetches the Server message for the error code.

Parameters
errorCodeint The full error code
Returns
string The Server message for the error

Definition at line 167 of file errorhandlermodule.c.

◆ InitOptionalVariables()

void InitOptionalVariables ( )

Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorProperties are created.

Definition at line 96 of file errorhandlermodule.c.

◆ InsertDialogueErrorProperties()

void InsertDialogueErrorProperties ( int  code,
string  message,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling, using the Optional Variables.

Definition at line 233 of file errorhandlermodule.c.

◆ InsertErrorProperties()

void InsertErrorProperties ( int  code,
string  message = "" 
)

Insert an error with no handling.

Definition at line 269 of file errorhandlermodule.c.

◆ InsertExtendedPrefixDialogueErrorProperties()

void InsertExtendedPrefixDialogueErrorProperties ( int  code,
string  message,
string  prefix,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling with extended prefix.

Definition at line 251 of file errorhandlermodule.c.

◆ InsertExtendedPrefixSplitDialogueErrorProperties()

void InsertExtendedPrefixSplitDialogueErrorProperties ( int  code,
string  message,
string  prefix,
string  serverMessage,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling with extended prefix and separate server message.

Definition at line 257 of file errorhandlermodule.c.

◆ InsertHeaderDialogueErrorProperties()

void InsertHeaderDialogueErrorProperties ( int  code,
string  message,
string  header,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling with custom header.

Definition at line 239 of file errorhandlermodule.c.

◆ InsertPrefixDialogueErrorProperties()

void InsertPrefixDialogueErrorProperties ( int  code,
string  message,
string  prefix,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling with custom prefix.

Definition at line 245 of file errorhandlermodule.c.

◆ InsertSplitDialogueErrorProperties()

void InsertSplitDialogueErrorProperties ( int  code,
string  message,
string  serverMessage,
int  dialogButtonType = DBT_OK,
int  defaultButton = DBB_OK,
int  dialogMeaningType = DMT_EXCLAMATION,
bool  displayAdditionalInfo = true 
)

Insert an error with Dialogue as handling with separate server message.

Definition at line 263 of file errorhandlermodule.c.

◆ OnErrorThrown()

protected override void OnErrorThrown ( int  errorCode,
owned string  additionalInfo = "" 
)

Event that gets triggered when an error of the owned category is thrown. Do not call directly! Call ErrorModuleHandler.ThrowError instead.

Parameters
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data

Definition at line 206 of file errorhandlermodule.c.

◆ ~ErrorHandlerModuleScript()

Definition at line 87 of file errorhandlermodule.c.

Variable Documentation

◆ m_ErrorDataMap

protected ref map<int, ref ErrorProperties> m_ErrorDataMap = new map<int, ref ErrorProperties>()

Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This contains at the very least the Message for the error Additionally, it can contain the way to handle the error (e.g. Throw a Dialogue with the message)

Definition at line 78 of file errorhandlermodule.c.

◆ m_Header

class ErrorHandlerModule m_Header = ""

This is where to input logic and extend functionality of ErrorHandlerModule.

Optional: Header (e.g. The header of a Dialogue box)

◆ m_LastAdditionalInfo

protected string m_LastAdditionalInfo = ""

Holds the last additional info passed in.

Definition at line 70 of file errorhandlermodule.c.

◆ m_LastErrorThrown

protected int m_LastErrorThrown = 0

Holds the last thrown error in this module, defaults to 0.

Definition at line 69 of file errorhandlermodule.c.

◆ m_Prefix

protected string m_Prefix = ""

Optional: Prefix (e.g. Fixed text at the start of the messages in the module)

Definition at line 66 of file errorhandlermodule.c.

◆ m_UIHandler

protected ref UIScriptedMenu m_UIHandler = null

Optional: The UI the handler might generally use

Definition at line 67 of file errorhandlermodule.c.