internal ErrorReport(AndroidErrorReport androidReport)
        {
            Id           = androidReport.Id;
            AppStartTime = DateTimeOffset.FromUnixTimeMilliseconds(androidReport.AppStartTime.Time);
            AppErrorTime = DateTimeOffset.FromUnixTimeMilliseconds(androidReport.AppErrorTime.Time);
            Device       = androidReport.Device == null ? null : new Device(androidReport.Device);
            object androidThrowable;

            try
            {
                androidThrowable = androidReport.Throwable;
            }
            catch (Exception e)
            {
                AppCenterLog.Debug(Crashes.LogTag, "Cannot read throwable from java point of view, probably a .NET exception", e);
                androidThrowable = null;
            }
            AndroidDetails = new AndroidErrorDetails(androidThrowable, androidReport.ThreadName);
            iOSDetails     = null;
            byte[] exceptionBytes = AndroidExceptionDataManager.LoadWrapperExceptionData(Java.Util.UUID.FromString(Id));
            if (exceptionBytes != null)
            {
                StackTrace = CrashesUtils.DeserializeException(exceptionBytes);
            }
        }
        internal ErrorReport(MSErrorReport 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);

            MSWrapperException wrapperException = MSWrapperExceptionManager.LoadWrapperExceptionWithUUID(msReport.IncidentIdentifier);

            if (wrapperException != null && wrapperException.ExceptionData != null)
            {
                Exception = CrashesUtils.DeserializeException(wrapperException.ExceptionData.ToArray());
            }
        }
Exemplo n.º 3
0
        static void OnUnhandledException(object sender, RaiseThrowableEventArgs e)
        {
            var exception = e.Exception;

            AppCenterLog.Error(LogTag, "Unhandled Exception:", exception);
            var javaThrowable  = exception as Throwable;
            var modelException = GenerateModelException(exception, true);

            byte[] rawException = javaThrowable == null?CrashesUtils.SerializeException(exception) : null;

            WrapperSdkExceptionManager.SaveWrapperException(Thread.CurrentThread(), javaThrowable, modelException, rawException);
        }
Exemplo n.º 4
0
        static void OnUnhandledException(Exception exception, string source)
        {
            if (_exception == null)
            {
                AppCenterLog.Error(LogTag, $"Unhandled Exception from source={source}", exception);
                var    javaThrowable  = exception as Throwable;
                var    modelException = GenerateModelException(exception, true);
                byte[] rawException   = javaThrowable == null?CrashesUtils.SerializeException(exception) : null;

                WrapperSdkExceptionManager.SaveWrapperException(Thread.CurrentThread(), javaThrowable, modelException, rawException);
                _exception = exception;
            }
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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.");
        }