215 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2",
m_Prefix,
message),
message,
m_Header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
221 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2",
m_Prefix,
message),
message,
header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
227 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2",
prefix,
message),
message,
m_Header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
233 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2%3",
m_Prefix,
prefix,
message),
message,
m_Header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
239 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2%3",
m_Prefix,
prefix,
message),
serverMessage,
m_Header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
245 m_ErrorDataMap.Insert(
code,
DialogueErrorProperties(
string.Format(
"%1%2",
m_Prefix,
message),
serverMessage,
m_Header,
m_UIHandler,
dialogButtonType,
defaultButton,
dialogMeaningType,
displayAdditionalInfo));
override void InitOptionalVariables()
override void FillErrorDataMap()
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.
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.
void ~ErrorHandlerModuleScript()
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!...
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
override string GetLastServerMessage(int errorCode)
Fetches the Server message for the error code, attempting to retrieve the data from the latest.
void ErrorHandlerModuleScript()
Constructor, by default calls the function that will fill the ErrorDataMap.
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.
string m_LastAdditionalInfo
Holds the last additional info passed in.
int m_LastErrorThrown
Holds the last thrown error in this module, defaults to 0.
override string GetLastClientMessage(int errorCode)
Fetches the Client message for the error code, attempting to retrieve the data from the latest.
ErrorProperties GetProperties(int errorCode)
Fetches the ErrorProperties for the error code.
ref UIScriptedMenu m_UIHandler
Optional: The UI the handler might generally use
ref map< int, ref ErrorProperties > m_ErrorDataMap
Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This...
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.
override string GetClientMessage(int errorCode, string additionalInfo="")
Fetches the Client message for the error code.
override string GetServerMessage(int errorCode, string additionalInfo="")
Fetches the Server message for the error code.
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.
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.
string m_Prefix
Optional: Prefix (e.g. Fixed text at the start of the messages in the module)
void InsertErrorProperties(int code, string message="")
Insert an error with no handling.
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
void DialogueErrorProperties(string message, string serverMessage, string header, UIScriptedMenu handler=null, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not mod...
proto native ErrorCategory GetCategory()
Returns the category the module handles.
void OnErrorThrown(int errorCode, owned string additionalInfo="")
Event that gets triggered when an error of the owned category is thrown.
string GetLastServerMessage(int errorCode)
Retrieve the message shown on Server.
proto native void SetCategory(ErrorCategory category)
Set the category the module handles.
string GetClientMessage(int errorCode, string additionalInfo="")
Retrieve the message shown on Client.
string GetLastClientMessage(int errorCode)
Retrieve the message shown on Client.
string GetSimpleMessage(int errorCode, string additionalInfo="")
Simple message of just code and info.
string GetServerMessage(int errorCode, string additionalInfo="")
Retrieve the message shown on Server.
void OnEvent(EventType eventTypeId, Param params)
Event called by ErrorModuleHandler.
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
Class which holds the properties and handling of an error.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.