summaryrefslogtreecommitdiffstats
path: root/win/C#/Program.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-04-14 19:56:36 +0000
committersr55 <[email protected]>2010-04-14 19:56:36 +0000
commit75dabf6f175daeddcb517b57fb23ec54396d4e00 (patch)
tree34e78b7f3fb7c0d5485ad0227c5dc5499d3b9d1b /win/C#/Program.cs
parent11da8e43bff624ee1dea51c99969ca5f97e44723 (diff)
WinGui:
- Enabled higher bitrate audio for aac. - Catch exceptions at application startup. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3224 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Program.cs')
-rw-r--r--win/C#/Program.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/win/C#/Program.cs b/win/C#/Program.cs
index 3085664fc..2bd66db5b 100644
--- a/win/C#/Program.cs
+++ b/win/C#/Program.cs
@@ -21,6 +21,8 @@ namespace Handbrake
[STAThread]
public static void Main()
{
+ AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+
const string failedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";
const string nightlyCLIMissing =
"If you have downloaded the \"HandBrakeGUI\" nightly, " +
@@ -61,5 +63,19 @@ namespace Handbrake
Application.Run(new frmMain());
}
}
+
+ /// <summary>
+ /// Throw up an error message for any unhandled exceptions.
+ /// </summary>
+ /// <param name="sender">The sender</param>
+ /// <param name="e">Unhandled Exception EventArgs </param>
+ private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ MessageBox.Show(
+ "An unexpected error has occured.\n\nSender:" + sender + "\n\nException:" + e.ExceptionObject,
+ "Unhandled Exception",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
}
} \ No newline at end of file