3 #ifndef GEODE_EXCEPTION_H_
4 #define GEODE_EXCEPTION_H_
27 #include "geode_globals.hpp"
34 #define GF_EX_MSG_LIMIT 2048
37 typedef SharedPtr<Exception> ExceptionPtr;
39 class DistributedSystem;
58 Exception(
const char* msg1,
const char* msg2 = NULL,
bool forceTrace =
false,
79 virtual const char* getMessage()
const;
83 virtual void showMessage()
const;
88 virtual void printStackTrace()
const;
94 virtual size_t getStackTrace(
char* buffer,
size_t maxLength)
const;
98 virtual const char* getName()
const;
104 virtual void raise() {
throw *
this; }
106 inline ExceptionPtr getCause()
const {
return m_cause; }
110 Exception(
const CacheableStringPtr& message,
const StackTracePtr& stack,
111 const ExceptionPtr& cause);
113 static bool s_exceptionStackTraceEnabled;
115 CacheableStringPtr m_message;
116 StackTracePtr m_stack;
117 ExceptionPtr m_cause;
120 static void setStackTraces(
bool stackTraceEnabled);
122 friend class DistributedSystem;
128 #endif // GEODE_EXCEPTION_H_