summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.h
diff options
context:
space:
mode:
authorBrad Linden <46733234+brad-linden@users.noreply.github.com>2024-03-04 17:43:08 -0800
committerGitHub <noreply@github.com>2024-03-04 17:43:08 -0800
commitdd74c2cbd542daa8d6cedba7ba7a68268f7b73d3 (patch)
treebe09c6b71ce5e7a1546bb8e9d48be9b6e34e8fb7 /indra/llcommon/llerror.h
parent1013ea51a88aba820d41db7fc259296291504c11 (diff)
parent6c43baf0298929ee315bdb3d95f0bd23f589a4cf (diff)
Merge pull request #928 from secondlife/andreyk/issue_54
Issue #54 LLRender::init crash and SL-17896
Diffstat (limited to 'indra/llcommon/llerror.h')
-rw-r--r--indra/llcommon/llerror.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index 05dd88ee51..6f6b349cf5 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -39,6 +39,7 @@
#include "llpreprocessor.h"
#include <boost/static_assert.hpp>
+#include <functional> // std::function
const int LL_ERR_NOERR = 0;
@@ -301,6 +302,28 @@ namespace LLError
{
friend std::ostream& operator<<(std::ostream& out, const LLStacktrace&);
};
+
+ // Provides access to OS notification popup on error, since
+ // not everything has access to OS's messages
+ class LLUserWarningMsg
+ {
+ public:
+ typedef std::function<void(const std::string&, const std::string&)> Handler;
+ static void setHandler(const Handler&);
+ static void setOutOfMemoryStrings(const std::string& title, const std::string& message);
+
+ // When viewer encounters bad alloc or can't access files try warning user about reasons
+ static void showOutOfMemory();
+ static void showMissingFiles();
+ // Genering error
+ static void show(const std::string&);
+
+ private:
+ // needs to be preallocated before viewer runs out of memory
+ static std::string sLocalizedOutOfMemoryTitle;
+ static std::string sLocalizedOutOfMemoryWarning;
+ static Handler sHandler;
+ };
}
//this is cheaper than llcallstacks if no need to output other variables to call stacks.