36 #define __func__ __FUNCTION__ 40 #define VALIDATE(cond, message) \ 43 throw_wml_exception(#cond, __FILE__, __LINE__, __func__, message); \ 47 #define VALIDATE_WITH_DEV_MESSAGE(cond, message, dev_message) \ 50 throw_wml_exception(#cond \ 59 #define FAIL(message) \ 61 throw_wml_exception(nullptr, __FILE__, __LINE__, __func__, message); \ 64 #define FAIL_WITH_DEV_MESSAGE(message, dev_message) \ 66 throw_wml_exception(nullptr \ 88 ,
const char *
function 89 ,
const std::string& message
90 ,
const std::string& dev_message =
"");
141 const std::string& section
142 ,
const std::string& key
143 ,
const std::string& primary_key =
"" 144 ,
const std::string& primary_value =
"");
158 const std::string& key
159 ,
const std::string& removal_version);
171 const std::string& deprecated_key
172 ,
const std::string& key
173 ,
const std::string& removal_version);
196 ,
const std::string& deprecated_key
197 ,
const std::string& key
198 ,
const std::string& removal_version);
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
Variant for storing WML attributes.
~wml_exception() noexcept
std::string deprecate_wml_key_warning(const std::string &key, const std::string &removal_version)
Returns a standard warning message for using a deprecated wml key.
std::string user_message
The message for the user explaining what went wrong.
Definitions for the interface to Wesnoth Markup Language (WML).
void show() const
Shows the error in a dialog.
const config::attribute_value & get_renamed_config_attribute(const config &cfg, const std::string &deprecated_key, const std::string &key, const std::string &removal_version)
Returns a config attribute, using either the old name or the new one.
std::string deprecated_renamed_wml_key_warning(const std::string &deprecated_key, const std::string &key, const std::string &removal_version)
Returns a standard warning message for using a deprecated renamed wml key.
wml_exception(const std::string &user_msg, const std::string &dev_msg)
void throw_wml_exception(const char *cond, const char *file, int line, const char *function, const std::string &message, const std::string &dev_message="")
Helper function, don't call this directly.
Helper class, don't construct this directly.
std::string dev_message
The message for developers telling which problem was triggered, this shouldn't be translated...
static int cond(LexState *ls)
A config object defines a single node in a WML file, with access to child nodes.
std::string missing_mandatory_wml_key(const std::string §ion, const std::string &key, const std::string &primary_key="", const std::string &primary_value="")
Returns a standard message for a missing wml key.
Base class for exceptions that want to be thrown 'through' lua.