Make editor handle errors with the old unsupported map format more gracefully

(bug #11023)
This commit is contained in:
Mark de Wever 2008-02-09 21:22:40 +00:00
parent f3f98c7525
commit 6e72e21c19
5 changed files with 20 additions and 0 deletions

View file

@ -8,6 +8,9 @@ Version 1.3.15+svn:
* replaced the font used for the chiense translation (gkai00mp.ttf) with a
subset of WQY (just the gb2312 part is included) as requested by the
chinese maintainer
* map editor:
* the editor handles errors with the old unsupported map format more
graceful (bug #11023)
* multiplayer:
* revised maps: The Freelands
* don't display 'Remote scenario' for reloaded games in the multiplayer

View file

@ -10,6 +10,10 @@ Version 1.3.15+svn:
subset of WQY (just the gb2312 part is included) as requested by the
chinese maintainer.
* Map editor
* The editor handles errors with the old unsupported map format more
graceful.
* Multiplayer
* Revised maps: The Freelands.
* Reloaded games are displayed in yellow (instead of green) in the game

View file

@ -38,6 +38,7 @@
#include "../util.hpp"
#include "../video.hpp"
#include "../wml_separators.hpp"
#include "../wml_exception.hpp"
#include "serialization/parser.hpp"
#include "serialization/string_utils.hpp"
@ -744,6 +745,8 @@ void map_editor::edit_resize() {
} catch (gamemap::incorrect_format_exception& e) {
std::cerr << "ERROR: " << e.msg_ << '\n';
gui::message_dialog(gui_, "", e.msg_).show();
} catch(twml_exception& e) {
e.show(gui_);
}
}
}

View file

@ -30,6 +30,7 @@
#include "../util.hpp"
#include "../video.hpp"
#include "../wesconfig.h"
#include "../wml_exception.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include "serialization/string_utils.hpp"
@ -358,6 +359,10 @@ int main(int argc, char** argv)
catch (gamemap::incorrect_format_exception) {
std::cerr << "The map is not in a correct format, sorry." << std::endl;
return 1;
} catch(twml_exception& e) {
std::cerr << "WML exception:\nUser message: "
<< e.user_message << "\nDev message: " << e.dev_message << '\n';
return 1;
} catch (CVideo::quit&) {
return 0;
}

View file

@ -22,6 +22,7 @@
#include "../config.hpp"
#include "../construct_dialog.hpp"
#include "../util.hpp"
#include "../wml_exception.hpp"
#include "serialization/string_utils.hpp"
#include <algorithm>
@ -396,6 +397,10 @@ bool valid_mapdata(const std::string &data, const config &cfg) {
}
catch (gamemap::incorrect_format_exception) {
res = false;
} catch(twml_exception& e) {
std::cerr << "WML exception:\nUser message: "
<< e.user_message << "\nDev message: " << e.dev_message << '\n';
return false;
}
return res;
}