diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 47e1001..29713b4 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -127,14 +127,17 @@ namespace EliteBGS { } private void ParseJournal_Click(object sender, RoutedEventArgs e) { - journal.Open(); // Load all files - - var start = startdate.SelectedDate ?? DateTime.Now; - var end = startdate.SelectedDate ?? DateTime.Now; - - report.Scan(journal, start, end); - - RefreshObjectives(); + try { + journal.Open(); // Load all files + var start = startdate.SelectedDate ?? DateTime.Now; + var end = startdate.SelectedDate ?? DateTime.Now; + report.Scan(journal, start, end); + RefreshObjectives(); + } catch (Exception exception) { + Log("Something went terribly wrong while parsing the E:D player journal."); + Log("Please send this to CMDR Hekateh:"); + Log(exception.ToString()); + } } private void AddObjective() { @@ -159,10 +162,16 @@ namespace EliteBGS { } private void GenerateDiscord_Click(object sender, RoutedEventArgs e) { - IDiscordLogGenerator discord = LogType.SelectedItem as IDiscordLogGenerator; - string report = discord.GenerateDiscordLog(Report); + try { + IDiscordLogGenerator discord = LogType.SelectedItem as IDiscordLogGenerator; + string report = discord.GenerateDiscordLog(Report); - DiscordLog.Text = report; + DiscordLog.Text = report; + } catch (Exception e) { + Log("Something went terribly wrong while generating the Discord log."); + Log("Please send this to CMDR Hekateh:"); + Log(e.ToString()); + } } private void RemoveCurrentObjective() { @@ -230,7 +239,7 @@ namespace EliteBGS { int system_id = systems_db.ToId(sys); station.Provider = new StationSuggestionProvider(stations_db, system_id); } catch (Exception exc) { - Log(exc.Message); + Log(exc.ToString()); } }