Helper class, don't construct this directly. More...
#include <wml_exception.hpp>
Public Types | |
enum class | error_type { INVALID_WML = 0 , GUI_LAYOUT_FAILURE = -1 } |
Public Member Functions | |
wml_exception (const std::string &user_msg, const std::string &dev_msg, const error_type error_type=error_type::INVALID_WML) | |
~wml_exception () noexcept | |
void | show () const |
Shows the error in a dialog. More... | |
![]() | |
virtual | ~lua_jailbreak_exception () noexcept |
void | store () const noexcept |
Stores a copy the current exception to be rethrown. More... | |
Public Attributes | |
std::string | user_message |
The message for the user explaining what went wrong. More... | |
std::string | dev_message |
The message for developers telling which problem was triggered, this shouldn't be translated. More... | |
error_type | type |
Indicates the category of the error handled by this expection. More... | |
Additional Inherited Members | |
![]() | |
static void | rethrow () |
Rethrows the stored exception. More... | |
![]() | |
static int | jail_depth = 0 |
Depth of recursive luaW_pcall_internal() function calls. More... | |
![]() | |
static lua_jailbreak_exception * | jailbreak_exception = nullptr |
The exception to be rethrown. More... | |
Helper class, don't construct this directly.
Definition at line 99 of file wml_exception.hpp.
|
strong |
Enumerator | |
---|---|
INVALID_WML | |
GUI_LAYOUT_FAILURE |
Definition at line 102 of file wml_exception.hpp.
|
inline |
Definition at line 107 of file wml_exception.hpp.
References lua_jailbreak_exception::store().
|
inlinenoexcept |
Definition at line 119 of file wml_exception.hpp.
void wml_exception::show | ( | ) | const |
Shows the error in a dialog.
Definition at line 60 of file wml_exception.cpp.
References _(), dev_message, gui2::show_error_message(), and user_message.
std::string wml_exception::dev_message |
The message for developers telling which problem was triggered, this shouldn't be translated.
It's hard for a dev to parse errors in foreign tongues.
Definition at line 132 of file wml_exception.hpp.
Referenced by show().
error_type wml_exception::type |
Indicates the category of the error handled by this expection.
Useful to detect the type of error without checking the detailed messages, especially in unit tests.
Definition at line 139 of file wml_exception.hpp.
std::string wml_exception::user_message |
The message for the user explaining what went wrong.
This message can be translated so the user gets a explanation in his/her native tongue.
Definition at line 125 of file wml_exception.hpp.
Referenced by show().