mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
try to get stack traces for InternalErrors, it doesn't work yet for errors caught with OnExceptionInMainLoop, because they are rethrown.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1260 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+5
-4
@@ -27,7 +27,7 @@ class Error {
|
||||
/// Return the error message
|
||||
virtual String what() const;
|
||||
|
||||
private:
|
||||
protected:
|
||||
String message; ///< The error message
|
||||
};
|
||||
|
||||
@@ -35,9 +35,7 @@ class Error {
|
||||
/// Internal errors
|
||||
class InternalError : public Error {
|
||||
public:
|
||||
inline InternalError(const String& str)
|
||||
: Error(_ERROR_1_("internal error", str.c_str()))
|
||||
{}
|
||||
InternalError(const String& str);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : File errors
|
||||
@@ -148,6 +146,9 @@ void handle_warning(const String& w, bool now = true);
|
||||
/** Should be called repeatedly (e.g. in an onIdle event handler) */
|
||||
void handle_pending_errors();
|
||||
|
||||
/// Make a stack trace for use in InternalErrors
|
||||
String get_stack_trace();
|
||||
|
||||
/// Catch all types of errors, and pass then to handle_error
|
||||
#define CATCH_ALL_ERRORS(handle_now) \
|
||||
catch (const Error& e) { \
|
||||
|
||||
Reference in New Issue
Block a user