Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
changeset 74:f1b7a08a8f6f
Re #177: "Crash" when equipmenttag
* Show custom dialog instead of crashing
Exception messages could still be improved and translatable
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 28 Sep 2009 19:56:50 +0000 |
parents | 12f11e3c6261 |
children | bdd10c56a917 |
files | FrmMain.cs |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmMain.cs Mon Sep 28 19:50:16 2009 +0000 +++ b/FrmMain.cs Mon Sep 28 19:56:50 2009 +0000 @@ -571,7 +571,18 @@ if (dr == DialogResult.OK) { - CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); + try + { + CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); + } + catch (RequiredDataMissingException ex) + { + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (InvalidFileException ex) + { + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } }