Package com.microsoft.appcenter.crashes
Class WrapperSdkExceptionManager
- java.lang.Object
-
- com.microsoft.appcenter.crashes.WrapperSdkExceptionManager
-
public class WrapperSdkExceptionManager extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ErrorReportbuildHandledErrorReport(android.content.Context context, java.lang.String errorReportId)Get a generic error report representation for an handled exception.static voiddeleteWrapperExceptionData(java.util.UUID errorId)Delete wrapper exception data from disk and store it in memorystatic com.microsoft.appcenter.utils.async.AppCenterFuture<java.util.Collection<ErrorReport>>getUnprocessedErrorReports()Get unprocessed error reports when automatic processing is disabled.static java.lang.StringloadWrapperExceptionData(java.util.UUID errorId)Load wrapper exception data into memorystatic java.util.UUIDsaveWrapperException(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 fromgetUnprocessedErrorReports().static voidsendErrorAttachments(java.lang.String errorReportId, java.lang.Iterable<ErrorAttachmentLog> attachments)Send error attachments when automatic processing is disabled.static voidsetAutomaticProcessing(boolean automaticProcessing)Set whether automatic processing is enabled or not.static java.lang.StringtrackException(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).
-
-
-
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 fromgetUnprocessedErrorReports(). 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 ofErrorAttachmentLogto be sent for the specified error report.
-
-