1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-10 21:33:36 +00:00

version bump. all unhandled crash report email

This commit is contained in:
Kyle Spearrin
2017-06-08 12:44:16 -04:00
parent c9b6df846e
commit 21f3755e44
3 changed files with 30 additions and 19 deletions

View File

@@ -38,12 +38,31 @@ namespace Bit.Android
public MainApplication(IntPtr handle, JniHandleOwnership transer)
: base(handle, transer)
{
AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;
if(!Resolver.IsSet)
{
SetIoc(this);
}
}
private void AndroidEnvironment_UnhandledExceptionRaiser(object sender, RaiseThrowableEventArgs e)
{
var message = AppendExceptionToMessage("", e.Exception);
Utilities.SendCrashEmail(message, false);
}
private string AppendExceptionToMessage(string message, Exception ex)
{
message += ("\n\n" + ex.Message + "\n\n" + ex.StackTrace);
if(ex.InnerException != null)
{
return AppendExceptionToMessage(message, ex.InnerException);
}
return message;
}
public override void OnCreate()
{
base.OnCreate();