nicer error reporting

This commit is contained in:
Gunter Labes 2007-11-16 23:18:27 +00:00
parent f473caf972
commit 8616624957
2 changed files with 7 additions and 7 deletions

View file

@ -1440,23 +1440,23 @@ bool game_controller::play_multiplayer()
} catch(game::game_error& e) { } catch(game::game_error& e) {
gui::show_error_message(disp(), _("Error while playing the game: ") + e.message); gui::show_error_message(disp(), _("Error while playing the game: ") + e.message);
} catch(network::error& e) { } catch(network::error& e) {
ERR_NET << "caught network::error";
if(e.message != "") { if(e.message != "") {
ERR_NET << ": " << e.message; ERR_NET << "caught network::error: " << e.message << "\n";
/* GCC-3.3 needs a temp var otherwise compilation fails */ /* GCC-3.3 needs a temp var otherwise compilation fails */
gui::dialog dlg(disp(),"",e.message,gui::OK_ONLY); gui::dialog dlg(disp(),"",e.message,gui::OK_ONLY);
dlg.show(); dlg.show();
} else {
ERR_NET << "caught network::error\n";
} }
ERR_NET << "\n";
} catch(config::error& e) { } catch(config::error& e) {
ERR_CONFIG << "caught config::error";
if(e.message != "") { if(e.message != "") {
ERR_CONFIG << ": " << e.message; ERR_CONFIG << "caught config::error: " << e.message << "\n";
/* GCC-3.3 needs a temp var otherwise compilation fails */ /* GCC-3.3 needs a temp var otherwise compilation fails */
gui::dialog dlg2(disp(),"",e.message,gui::OK_ONLY); gui::dialog dlg2(disp(),"",e.message,gui::OK_ONLY);
dlg2.show(); dlg2.show();
} else {
ERR_CONFIG << "caught config::error\n";
} }
ERR_CONFIG << "\n";
} catch(gamemap::incorrect_format_exception& e) { } catch(gamemap::incorrect_format_exception& e) {
gui::show_error_message(disp(), std::string(_("The game map could not be loaded: ")) + e.msg_); gui::show_error_message(disp(), std::string(_("The game map could not be loaded: ")) + e.msg_);
} catch(game::load_game_exception& e) { } catch(game::load_game_exception& e) {

View file

@ -197,7 +197,7 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
eras.push_back((**er)["name"]); eras.push_back((**er)["name"]);
} }
if(eras.empty()) { if(eras.empty()) {
gui::message_dialog(disp, "", _("No multiplayer sides.")).show(); gui::message_dialog(disp, "", _("No eras found.")).show();
throw config::error(_("No eras found")); throw config::error(_("No eras found"));
} }
era_combo_.set_items(eras); era_combo_.set_items(eras);