36   #define __func__ __FUNCTION__ 
   40 #define VALIDATE(cond, message)                                           \ 
   43             throw_wml_exception(#cond, __FILE__, __LINE__, __func__, message);  \ 
   47 #define VALIDATE_WML_CHILD(cfg, key, message)                                             \ 
   48     ([](auto c, auto k) {                                                             \ 
   49         if(auto child = c.optional_child(k)) { return *child; }                       \ 
   50         throw_wml_exception( "Missing [" key "]", __FILE__, __LINE__, __func__, message); \
 
   53 #define VALIDATE_WITH_DEV_MESSAGE(cond, message, dev_message)             \ 
   56             throw_wml_exception(#cond                                           \ 
   65 #define FAIL(message)                                                     \ 
   67         throw_wml_exception(nullptr, __FILE__, __LINE__, __func__, message);       \ 
   70 #define FAIL_WITH_DEV_MESSAGE(message, dev_message)                       \ 
   72         throw_wml_exception(nullptr                                                \ 
   94         , 
const char *
function 
   95         , 
const std::string& message
 
   96         , 
const std::string& dev_message = 
"");
 
  108         const std::string& user_msg,
 
  109         const std::string& dev_msg,
 
  166           const std::string& section
 
  167         , 
const std::string& key
 
  168         , 
const std::string& primary_key = 
"" 
  169         , 
const std::string& primary_value = 
"");
 
  181           const std::string& section
 
  182         , 
const std::string& 
tag);
 
Base class for exceptions that want to be thrown 'through' lua.
void store() const noexcept
Stores a copy the current exception to be rethrown.
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
void line(int from_x, int from_y, int to_x, int to_y)
Draw a line.
std::string tag(std::string_view tag, Args &&... data)
Wraps the given data in the specified tag.
Helper class, don't construct this directly.
error_type type
Indicates the category of the error handled by this expection.
void show() const
Shows the error in a dialog.
std::string dev_message
The message for developers telling which problem was triggered, this shouldn't be translated.
wml_exception(const std::string &user_msg, const std::string &dev_msg, const error_type error_type=error_type::INVALID_WML)
std::string user_message
The message for the user explaining what went wrong.
~wml_exception() noexcept
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 (attribute).
std::string missing_mandatory_wml_tag(const std::string §ion, const std::string &tag)
Returns a standard message for a missing wml child (tag).
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.