moved crash handling to MagicGameReport

master
melvin 2011-08-29 00:07:55 +08:00
parent 607b758fea
commit 00450dca01
1 changed files with 1 additions and 12 deletions

View File

@ -219,18 +219,7 @@ public final class GamePanel extends JPanel {
try { //handle any unrecoverable exception in the controller
controller.runGame();
} catch (final Throwable ex) {
//unrecoverable error has occurred!
try {
//buildReport might throw an exception
System.err.println(MagicGameReport.buildReport(game));
} catch (final Throwable ex2) {
System.err.println("Exception from MagicGameReport.buildReport:");
System.err.println(ex2.getMessage());
ex2.printStackTrace();
}
System.err.println("Exception from controller.runGame:");
System.err.println(ex.getMessage());
ex.printStackTrace();
MagicGameReport.buildReport(game, ex);
System.exit(1);
}
System.err.println("Stopping game...");