/// <summary> /// We don't assume order between java crash handler and c# crash handler. /// This method is called after either of those 2 events and is thus effective only the second time when we got both the c# exception and the Android error log. /// </summary> private static void JoinExceptionAndLog() { /* * We don't assume order between java crash handler and c# crash handler. * This method is called after either of those 2 events. * It is thus effective only the second time when we got both the .NET exception and the Android error log. */ if (_errorLog != null && _exception != null) { /* * Generate structured data for the C# exception and overwrite the Java exception to enhance it. * Unless if we have java exception in top cause, this would make it worse. * Having java exception as intermediate cause is better with .NET stack structure though. */ if (!(_exception is Java.Lang.Exception)) { _errorLog.Exception = GenerateModelException(_exception); /* Tell the Android SDK to overwrite the modified error log on disk. */ AndroidExceptionDataManager.SaveWrapperSdkErrorLog(_errorLog); } /* Save the System.Exception to disk as a serialized object for client side inspection. */ byte[] exceptionData = CrashesUtils.SerializeException(_exception); AndroidExceptionDataManager.SaveWrapperExceptionData(exceptionData, _errorLog.Id); } }
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception systemException = e.ExceptionObject as Exception; MSException exception = GenerateiOSException(systemException); MSWrapperExceptionManager.SetWrapperException(exception); byte[] exceptionBytes = CrashesUtils.SerializeException(systemException); NSData wrapperExceptionData = NSData.FromArray(exceptionBytes); MSWrapperExceptionManager.SetWrapperExceptionData(wrapperExceptionData); }
private static void OnUnhandledException(object sender, RaiseThrowableEventArgs e) { var exception = e.Exception; MobileCenterLog.Error(Crashes.LogTag, "Unhandled Exception:", exception); if (!(exception is Java.Lang.Exception)) { var modelException = GenerateModelException(exception, true); byte[] rawException = CrashesUtils.SerializeException(exception); WrapperSdkExceptionManager.SaveWrapperException(Thread.CurrentThread(), modelException, rawException); } }
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception systemException = e.ExceptionObject as Exception; MSException exception = GenerateiOSException(systemException, true); byte[] exceptionBytes = CrashesUtils.SerializeException(systemException); NSData wrapperExceptionData = NSData.FromArray(exceptionBytes); MSWrapperException wrapperException = new MSWrapperException { Exception = exception, ExceptionData = wrapperExceptionData, ProcessId = new NSNumber(Process.GetCurrentProcess().Id) }; MSWrapperExceptionManager.SaveWrapperException(wrapperException); }
/// <summary> /// We don't assume order between java crash handler and c# crash handler. /// This method is called after either of those 2 events and is thus effective only the second time when we got both the c# exception and the Android error log. /// </summary> private static void JoinExceptionAndLog() { /* * We don't assume order between java crash handler and c# crash handler. * This method is called after either of those 2 events. * It is thus effective only the second time when we got both the c# exception and the Android error log. */ if (_errorLog != null && _exception != null) { /* Generate structured data for the C# exception and overwrite the Java exception. */ _errorLog.Exception = GenerateModelException(_exception); /* Tell the Android SDK to overwrite the modified error log on disk. */ AndroidExceptionDataManager.SaveWrapperSdkErrorLog(_errorLog); /* Save the System.Exception to disk as a serialized object. */ byte[] exceptionData = CrashesUtils.SerializeException(_exception); AndroidExceptionDataManager.SaveWrapperExceptionData(exceptionData, _errorLog.Id); } }