Reverted 2011-01-08T20:40:28Z!koraq@xs4all.nl. (Fix for bug #17577.)

This commit is contained in:
Guillaume Melquiond 2011-01-26 07:30:35 +00:00
parent c75517c403
commit f6e5953933
5 changed files with 8 additions and 18 deletions

View file

@ -61,7 +61,7 @@ editor_map editor_map::from_string(const config& terrain_cfg, const std::string&
} catch (incorrect_map_format_error& e) {
throw wrap_exc("format", e.message, "");
} catch (twml_exception& e) {
throw wrap_exc("wml", e.user_message, "");
throw wrap_exc("wml", e.message, "");
} catch (config::error& e) {
throw wrap_exc("config", e.message, "");
}

View file

@ -2483,7 +2483,7 @@ int main(int argc, char** argv)
std::cerr << "caught end_level_exception (quitting)\n";
} catch(twml_exception& e) {
std::cerr << "WML exception:\nUser message: "
<< e.user_message << "\nDev message: " << e.dev_message << '\n';
<< e.message << "\nDev message: " << e.dev_message << '\n';
return 1;
} catch(game_logic::formula_error& e) {
std::cerr << e.what()

View file

@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(test_make_test_fake)
gui2::tmessage dlg("title", "message", true);
dlg.show(video, 1);
} catch(twml_exception& e) {
BOOST_CHECK(e.user_message == _("Failed to show a dialog, "
BOOST_CHECK(e.message == _("Failed to show a dialog, "
"which doesn't fit on the screen."));
return;
} catch(...) {

View file

@ -55,7 +55,7 @@ void twml_exception::show(display &disp)
// The extra spaces between the \n are needed, otherwise the dialog doesn't show
// an empty line.
sstr << _("An error due to possibly invalid WML occurred\nThe error message is :")
<< "\n" << user_message << "\n \n"
<< "\n" << message << "\n \n"
<< _("When reporting the bug please include the following error message :")
<< "\n" << dev_message;

View file

@ -23,8 +23,7 @@
#define WML_EXCEPTION_HPP_INCLUDED
#include "config.hpp"
#include <string>
#include "exceptions.hpp"
class display;
@ -83,22 +82,13 @@ void wml_exception(
, const std::string& dev_message = "");
/** Helper class, don't construct this directly. */
struct twml_exception
struct twml_exception: game::error
{
twml_exception(const std::string& user_msg, const std::string& dev_msg)
: user_message(user_msg)
, dev_message(dev_msg)
{
}
twml_exception(const std::string &user_msg, const std::string &dev_msg)
: game::error(user_msg), dev_message(dev_msg) {}
~twml_exception() throw() {}
/**
* 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.
*/
std::string user_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