Skip to content

Commit

Permalink
Report error before application closes.
Browse files Browse the repository at this point in the history
  • Loading branch information
phw198 committed Sep 25, 2021
1 parent 1d52dd3 commit c186d34
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/OutlookGoogleCalendarSync/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release-clean\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<FileAlignment>4096</FileAlignment>
Expand Down
3 changes: 2 additions & 1 deletion src/OutlookGoogleCalendarSync/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private static void Main(string[] args) {

} catch (System.Runtime.InteropServices.COMException ex) {
OGCSexception.Analyse(ex);
MessageBox.Show(ex.Message, "Application terminated!", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw new ApplicationException("Suggest startup delay");
}

Expand All @@ -96,7 +97,7 @@ private static void Main(string[] args) {
"Set a delay on startup", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
} else if (!string.IsNullOrEmpty(aex.Message))
MessageBox.Show(aex.Message, "Application terminated", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(aex.Message, "Application terminated!", MessageBoxButtons.OK, MessageBoxIcon.Error);
log.Warn("OGCS has crashed out.");

} catch (System.Exception ex) {
Expand Down

0 comments on commit c186d34

Please sign in to comment.