Author: mordante
Date: Sat Nov 1 17:43:32 2008
New Revision: 30502
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30502&view=rev
Log:
Catch game_logic::formula_error.
Instead of silently aborting show an error message before aborting.
Modified:
trunk/src/game.cpp
Modified: trunk/src/game.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=30502&r1=30501&r2=30502&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Nov 1 17:43:32 2008
@@ -28,6 +28,7 @@
#include "game_display.hpp"
#include "filesystem.hpp"
#include "font.hpp"
+#include "formula.hpp"
#include "game_config.hpp"
#include "game_errors.hpp"
#include "gamestatus.hpp"
@@ -2130,6 +2131,11 @@
} catch(twml_exception& e) {
std::cerr << "WML exception:\nUser message: "
<< e.user_message << "\nDev message: " << e.dev_message
<< '\n';
+ } catch(game_logic::formula_error& e) {
+ std::cerr << "Formula error found in " << e.filename_ << ":" <<
e.line_
+ << "\nIn formula " << e.formula_
+ << "\nError: " << e.type_
+ << "\n\nGame will be aborted.\n";
}
return 0;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits