# HG changeset patch # User Dan.Kulinski@dank-laptop.Global.Local # Date 1313726359 21600 # Node ID a0df71b24972c30b2d4318c140cad6e0c41b8a9b # Parent a6ce13e4ae899c5e25fdd46f41a55fd1b1ee78a0 Added basic exception handling (a one case fits all) diff -r a6ce13e4ae89 -r a0df71b24972 FrmXmlExport.cs --- a/FrmXmlExport.cs Thu Aug 18 11:15:51 2011 -0600 +++ b/FrmXmlExport.cs Thu Aug 18 21:59:19 2011 -0600 @@ -7,6 +7,7 @@ using System.Text; using System.IO; using System.Windows.Forms; +using System.Xml.Xsl; using IBBoard.WarFoundry.API.Objects; using IBBoard.WarFoundry.API.Exporters; @@ -54,7 +55,14 @@ { if (cbApplyTransform.Checked) { - WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text); + try + { + WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text); + } + catch (Exception ex) + { + MessageBox.Show(this, "Sorry, but an error occurred during export.", "Error on export", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } } else {