diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-01-23 13:59:56 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-01-23 13:59:56 +0800 |
commit | a9a601de76da660a454fab779395ab4959765b7a (patch) | |
tree | 5f412d2c9d764086099071ecfe8dc0e925318e55 /indra/llcommon | |
parent | 3437b6d6f5328c5f067f718ef5ae378d97427f05 (diff) | |
parent | ad30637ebe987a126302dc7fd978e0bfb988ccb1 (diff) |
Merge remote-tracking branch 'secondlife/release/2024.12-ForeverFPS' into 2024.12-ForeverFPS
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llerror.cpp | 8 | ||||
-rw-r--r-- | indra/llcommon/llerror.h | 12 |
2 files changed, 14 insertions, 6 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 90c6ba309b..d834098994 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1604,11 +1604,11 @@ namespace LLError std::string LLUserWarningMsg::sLocalizedOutOfMemoryWarning; LLUserWarningMsg::Handler LLUserWarningMsg::sHandler; - void LLUserWarningMsg::show(const std::string& message) + void LLUserWarningMsg::show(const std::string& message, S32 error_code) { if (sHandler) { - sHandler(std::string(), message); + sHandler(std::string(), message, error_code); } } @@ -1616,7 +1616,7 @@ namespace LLError { if (sHandler && !sLocalizedOutOfMemoryTitle.empty()) { - sHandler(sLocalizedOutOfMemoryTitle, sLocalizedOutOfMemoryWarning); + sHandler(sLocalizedOutOfMemoryTitle, sLocalizedOutOfMemoryWarning, ERROR_BAD_ALLOC); } } @@ -1627,7 +1627,7 @@ namespace LLError "Second Life viewer couldn't access some of the files it needs and will be closed." "\n\nPlease reinstall viewer from https://secondlife.com/support/downloads/ and " "contact https://support.secondlife.com if issue persists after reinstall."; - sHandler("Missing Files", error_string); + sHandler("Missing Files", error_string, ERROR_MISSING_FILES); } void LLUserWarningMsg::setHandler(const LLUserWarningMsg::Handler &handler) diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 8a143ff30a..87625b6ead 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -308,7 +308,15 @@ namespace LLError class LLUserWarningMsg { public: - typedef std::function<void(const std::string&, const std::string&)> Handler; + typedef enum + { + ERROR_OTHER = 0, + ERROR_BAD_ALLOC = 1, + ERROR_MISSING_FILES = 2, + } eLastExecEvent; + + // tittle, message and error code to include in error marker file + typedef std::function<void(const std::string&, const std::string&, S32 error_code)> Handler; static void setHandler(const Handler&); static void setOutOfMemoryStrings(const std::string& title, const std::string& message); @@ -316,7 +324,7 @@ namespace LLError static void showOutOfMemory(); static void showMissingFiles(); // Genering error - static void show(const std::string&); + static void show(const std::string&, S32 error_code = -1); private: // needs to be preallocated before viewer runs out of memory |