-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now sending crash dumps ! -> 1.0.1.4
- Loading branch information
1 parent
72d315a
commit 0f68abd
Showing
5 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
| ||
using System.Windows; | ||
using System.Threading.Tasks; | ||
using System.Windows.Threading; | ||
using CrashReporterDotNET; | ||
using System; | ||
|
||
namespace NaturalLauncher | ||
{ | ||
|
@@ -8,5 +12,45 @@ namespace NaturalLauncher | |
/// </summary> | ||
public partial class App : Application | ||
{ | ||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
base.OnStartup(e); | ||
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; | ||
Application.Current.DispatcherUnhandledException += DispatcherOnUnhandledException; | ||
TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException; | ||
} | ||
|
||
private void TaskSchedulerOnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs unobservedTaskExceptionEventArgs) | ||
{ | ||
SendReport(unobservedTaskExceptionEventArgs.Exception); | ||
Environment.Exit(0); | ||
} | ||
|
||
private void DispatcherOnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs dispatcherUnhandledExceptionEventArgs) | ||
{ | ||
SendReport(dispatcherUnhandledExceptionEventArgs.Exception); | ||
Environment.Exit(0); | ||
} | ||
|
||
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) | ||
{ | ||
SendReport((Exception)unhandledExceptionEventArgs.ExceptionObject); | ||
Environment.Exit(0); | ||
} | ||
|
||
public static void SendReport(Exception exception, string developerMessage = "") | ||
{ | ||
var reportCrash = new ReportCrash("[email protected]"); // mail to send crash dumps to | ||
reportCrash.DeveloperMessage = developerMessage; | ||
reportCrash.DoctorDumpSettings = new DoctorDumpSettings | ||
{ | ||
ApplicationID = new Guid("abac8312-371a-4fad-aa9d-b4b0cd5d11ab"), | ||
}; | ||
/*var reportCrash = new ReportCrash("Email where you want to receive crash reports.") | ||
{ | ||
DeveloperMessage = developerMessage | ||
};*/ | ||
reportCrash.Send(exception); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters