Class WrapperSdkExceptionManager


  • public class WrapperSdkExceptionManager
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ErrorReport buildHandledErrorReport​(android.content.Context context, java.lang.String errorReportId)
      Get a generic error report representation for an handled exception.
      static void deleteWrapperExceptionData​(java.util.UUID errorId)
      Delete wrapper exception data from disk and store it in memory
      static com.microsoft.appcenter.utils.async.AppCenterFuture<java.util.Collection<ErrorReport>> getUnprocessedErrorReports()
      Get unprocessed error reports when automatic processing is disabled.
      static java.lang.String loadWrapperExceptionData​(java.util.UUID errorId)
      Load wrapper exception data into memory
      static java.util.UUID saveWrapperException​(java.lang.Thread thread, java.lang.Throwable throwable, Exception modelException, java.lang.String rawSerializedException)
      Save a crash from wrapper SDK.
      static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> sendCrashReportsOrAwaitUserConfirmation​(java.util.Collection<java.lang.String> filteredReportIds)
      Resume processing of crash reports with the filtered list from getUnprocessedErrorReports().
      static void sendErrorAttachments​(java.lang.String errorReportId, java.lang.Iterable<ErrorAttachmentLog> attachments)
      Send error attachments when automatic processing is disabled.
      static void setAutomaticProcessing​(boolean automaticProcessing)
      Set whether automatic processing is enabled or not.
      static java.lang.String trackException​(Exception modelException, java.util.Map<java.lang.String,​java.lang.String> properties, java.lang.Iterable<ErrorAttachmentLog> attachments)
      Send an handled exception (used by wrapper SDKs).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • saveWrapperException

        public static java.util.UUID saveWrapperException​(java.lang.Thread thread,
                                                          java.lang.Throwable throwable,
                                                          Exception modelException,
                                                          java.lang.String rawSerializedException)
        Save a crash from wrapper SDK.
        Parameters:
        thread - thread where uncaught exception originated.
        throwable - Java throwable for client side inspection if available, can be null.
        modelException - model exception.
        rawSerializedException - raw exception string if available, can be null.
        Returns:
        error log identifier if successful or null if failed to save to disk.
      • deleteWrapperExceptionData

        public static void deleteWrapperExceptionData​(java.util.UUID errorId)
        Delete wrapper exception data from disk and store it in memory
        Parameters:
        errorId - The associated error UUID
      • loadWrapperExceptionData

        public static java.lang.String loadWrapperExceptionData​(java.util.UUID errorId)
        Load wrapper exception data into memory
        Parameters:
        errorId - The associated error UUID
        Returns:
        The data loaded into memory
      • trackException

        public static java.lang.String trackException​(Exception modelException,
                                                      java.util.Map<java.lang.String,​java.lang.String> properties,
                                                      java.lang.Iterable<ErrorAttachmentLog> attachments)
        Send an handled exception (used by wrapper SDKs).
        Parameters:
        modelException - An handled exception already in JSON model form.
        properties - optional properties.
        attachments - optional attachments.
        Returns:
        error report ID.
      • setAutomaticProcessing

        public static void setAutomaticProcessing​(boolean automaticProcessing)
        Set whether automatic processing is enabled or not. Default is enabled.
        Parameters:
        automaticProcessing - true to enable, false otherwise.
      • getUnprocessedErrorReports

        public static com.microsoft.appcenter.utils.async.AppCenterFuture<java.util.Collection<ErrorReport>> getUnprocessedErrorReports()
        Get unprocessed error reports when automatic processing is disabled.
        Returns:
        unprocessed error reports as an async future.
      • sendCrashReportsOrAwaitUserConfirmation

        public static com.microsoft.appcenter.utils.async.AppCenterFuture<java.lang.Boolean> sendCrashReportsOrAwaitUserConfirmation​(java.util.Collection<java.lang.String> filteredReportIds)
        Resume processing of crash reports with the filtered list from getUnprocessedErrorReports(). To use when automatic processing is disabled.
        Parameters:
        filteredReportIds - report identifiers to process, every crash not part of the original list are discarded.
        Returns:
        asynchronous result: true if ALWAYS_SEND was previously set, false otherwise.
      • buildHandledErrorReport

        public static ErrorReport buildHandledErrorReport​(android.content.Context context,
                                                          java.lang.String errorReportId)
        Get a generic error report representation for an handled exception. Since this is used by wrapper SDKs, stack trace and thread name are not known at Java level.
        Parameters:
        context - context.
        errorReportId - The error report identifier.
        Returns:
        an error report.
      • sendErrorAttachments

        public static void sendErrorAttachments​(java.lang.String errorReportId,
                                                java.lang.Iterable<ErrorAttachmentLog> attachments)
        Send error attachments when automatic processing is disabled.
        Parameters:
        errorReportId - The error report identifier to send attachments for.
        attachments - instances of ErrorAttachmentLog to be sent for the specified error report.