internal ErrorReport(MSACErrorReport msReport) { // If Id is not null we have loaded the report from the cache if (Id != null) { return; } Id = msReport.IncidentIdentifier; AppStartTime = NSDateToDateTimeOffset(msReport.AppStartTime); AppErrorTime = NSDateToDateTimeOffset(msReport.AppErrorTime); Device = msReport.Device == null ? null : new Device(msReport.Device); AndroidDetails = null; iOSDetails = new iOSErrorDetails(msReport.ReporterKey, msReport.Signal, msReport.ExceptionName, msReport.ExceptionReason, (uint)msReport.AppProcessIdentifier); MSACWrapperException wrapperException = MSACWrapperExceptionManager.LoadWrapperExceptionWithUUID(msReport.IncidentIdentifier); if (wrapperException != null && wrapperException.ExceptionData != null && wrapperException.ExceptionData.Length > 0) { StackTrace = CrashesUtils.DeserializeException(wrapperException.ExceptionData.ToArray()); } }
static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { var systemException = e.ExceptionObject as Exception; AppCenterLog.Error(LogTag, "Unhandled Exception:", systemException); var exception = GenerateiOSException(systemException, true); var exceptionBytes = CrashesUtils.SerializeException(systemException) ?? new byte[0]; var wrapperExceptionData = NSData.FromArray(exceptionBytes); var wrapperException = new MSACWrapperException { Exception = exception, ExceptionData = wrapperExceptionData, ProcessId = new NSNumber(Process.GetCurrentProcess().Id) }; AppCenterLog.Info(LogTag, "Saving wrapper exception..."); MSACWrapperExceptionManager.SaveWrapperException(wrapperException); AppCenterLog.Info(LogTag, "Saved wrapper exception."); }