private static IEnumerator SendUnhandledExceptionReports() { yield return(null); // ensure that code is executed in main thread while (true) { Exception exception = null; lock (_unhandledExceptions) { if (_unhandledExceptions.Count > 0) { exception = _unhandledExceptions.Dequeue(); } else { yield break; } } if (exception != null) { var exceptionWrapper = CreateWrapperException(exception); CrashesInternal.TrackException(exceptionWrapper.GetRawObject()); } yield return(null); // report remaining exceptions on next frames } }
public static void OnHandleLog(string logString, string stackTrace, LogType type) { if (LogType.Assert == type || LogType.Exception == type || LogType.Error == type) { var exception = CreateWrapperException(logString, stackTrace, type); CrashesInternal.TrackException(exception.GetRawObject()); } }
public static void TrackError(Exception exception, IDictionary <string, string> properties = null, params ErrorAttachmentLog[] attachments) { if (exception != null) { var exceptionWrapper = CreateWrapperException(exception); CrashesInternal.TrackException(exceptionWrapper.GetRawObject(), properties, attachments); } }
private static void SendErrorAttachments(string errorReportId) { // Send attachments for error report. var errorReport = CrashesInternal.BuildHandledErrorReport(errorReportId); errorReport.IsCrash = false; var attachments = CrashesDelegate.GetErrorAttachmentsHandler == null ? null : CrashesDelegate.GetErrorAttachmentsHandler(errorReport); CrashesInternal.SendErrorAttachments(errorReportId, attachments); }
private static void TrackErrorWithAttachments(Exception exception) { var exceptionWrapper = CreateWrapperException(exception); var errorId = CrashesInternal.TrackException(exceptionWrapper.GetRawObject(), null, null); // If the main thread is not crashed, attachments should be sent. if (_enableErrorAttachmentsCallbacks) { SendErrorAttachments(errorId); } }
public static void OnHandleLog(string logString, string stackTrace, LogType type) { if (LogType.Assert == type || LogType.Exception == type || LogType.Error == type) { var exception = CreateWrapperException(logString, stackTrace, type); var errorReportId = CrashesInternal.TrackException(exception.GetRawObject(), null, null); if (_enableErrorAttachmentsCallbacks) { SendErrorAttachments(errorReportId); } } }
public static void TrackError(Exception exception, IDictionary <string, string> properties = null) { if (exception != null) { var exceptionWrapper = CreateWrapperException(exception); if (properties == null || properties.Count == 0) { CrashesInternal.TrackException(exceptionWrapper.GetRawObject()); } else { CrashesInternal.TrackException(exceptionWrapper.GetRawObject(), properties); } } }
public static void OnHandleUnresolvedException(object sender, UnhandledExceptionEventArgs args) { if (args == null || args.ExceptionObject == null) { return; } var exception = args.ExceptionObject as Exception; if (exception != null) { Debug.Log("Unhandled exception: " + exception.ToString()); #if UNITY_ANDROID lock (_unhandledExceptions) { _unhandledExceptions.Enqueue(exception); } UnityCoroutineHelper.StartCoroutine(SendUnhandledExceptionReports); #else var exceptionWrapper = CreateWrapperException(exception); CrashesInternal.TrackException(exceptionWrapper.GetRawObject()); #endif } }
public static void AddNativeType(List <RawType> nativeTypes) { CrashesInternal.AddNativeType(nativeTypes); }
public static void StartCrashes() { CrashesInternal.StartCrashes(); }
public static void NotifyUserConfirmation(ConfirmationResult answer) { CrashesInternal.NotifyWithUserConfirmation(answer); }
public static AppCenterTask <string> GetMinidumpDirectoryAsync() { return(CrashesInternal.GetMinidumpDirectoryAsync()); }
public static AppCenterTask <bool> HasCrashedInLastSessionAsync() { return(CrashesInternal.HasCrashedInLastSessionAsync()); }
public static void GenerateTestCrash() { CrashesInternal.GenerateTestCrash(); }
public static AppCenterTask SetEnabledAsync(bool enabled) { return(CrashesInternal.SetEnabledAsync(enabled)); }
public static AppCenterTask <bool> IsEnabledAsync() { return(CrashesInternal.IsEnabledAsync()); }
public static void DisableMachExceptionHandler() { CrashesInternal.DisableMachExceptionHandler(); }
public static AppCenterTask <ErrorReport> GetLastSessionCrashReportAsync() { return(CrashesInternal.GetLastSessionCrashReportAsync()); }
public static AppCenterTask <bool> HasReceivedMemoryWarningInLastSessionAsync() { return(CrashesInternal.HasReceivedMemoryWarningInLastSessionAsync()); }
public static ErrorReport LastSessionCrashReport() { return(CrashesInternal.LastSessionCrashReport()); }