Package com.bugsnag

Class Report


  • public class Report
    extends java.lang.Object
    • Constructor Detail

      • Report

        protected Report​(Configuration config,
                         java.lang.Throwable throwable)
        Create a report for the error.
        Parameters:
        config - the configuration for the report.
        throwable - the error to create the report for.
    • Method Detail

      • getPayloadVersion

        protected java.lang.String getPayloadVersion()
      • getExceptions

        protected java.util.List<com.bugsnag.Exception> getExceptions()
        Get the exceptions for the report.
        Returns:
        the exceptions that make up the error.
      • getThreads

        protected java.util.List<com.bugsnag.ThreadState> getThreads()
      • getGroupingHash

        public java.lang.String getGroupingHash()
      • getSeverity

        public java.lang.String getSeverity()
      • getContext

        public java.lang.String getContext()
      • getApp

        public java.util.Map<java.lang.String,​java.lang.Object> getApp()
      • getDevice

        public java.util.Map<java.lang.String,​java.lang.Object> getDevice()
      • getUser

        public java.util.Map<java.lang.String,​java.lang.String> getUser()
      • getMetaData

        public java.util.Map<java.lang.String,​java.lang.Object> getMetaData()
      • getException

        public java.lang.Throwable getException()
        Returns:
        The exception which triggered this error report.
      • getExceptionName

        public java.lang.String getExceptionName()
        Returns:
        the class name from the exception contained in this error report.
      • setExceptionName

        public void setExceptionName​(java.lang.String exceptionName)
        Sets the class name from the exception contained in this error report.
        Parameters:
        exceptionName - the error name
      • getExceptionMessage

        public java.lang.String getExceptionMessage()
        Returns:
        The message from the exception contained in this error report.
      • addToTab

        public Report addToTab​(java.lang.String tabName,
                               java.lang.String key,
                               java.lang.Object value)
        Add a key value pair to a metadata tab.
        Parameters:
        tabName - the name of the tab to add the key value pair to
        key - the key of the metadata to add
        value - the metadata value to add
        Returns:
        the modified report
      • clearTab

        public Report clearTab​(java.lang.String tabName)
        Clear all of the keys from the given tab.
        Parameters:
        tabName - the name of the tab to clear.
        Returns:
        The message from the exception contained in this error report.
      • setAppInfo

        @Deprecated
        public Report setAppInfo​(java.lang.String key,
                                 java.lang.Object value)
        Deprecated.
        Add some application info on the report.
        Parameters:
        key - the key of app info to add
        value - the value of app info to add
        Returns:
        the modified report
      • setApiKey

        public Report setApiKey​(java.lang.String apiKey)
        Set the API key for the report.
        Parameters:
        apiKey - the API key to use in the report
        Returns:
        the modified report
      • getApiKey

        protected java.lang.String getApiKey()
        Get the API key in the report.
        Returns:
        the API key in the report
      • setContext

        public Report setContext​(java.lang.String context)
        Set context of the report.
        Parameters:
        context - the context to use in the report
        Returns:
        the modified report
      • setDeviceInfo

        @Deprecated
        public Report setDeviceInfo​(java.lang.String key,
                                    java.lang.Object value)
        Deprecated.
        Set device information on the report.
        Parameters:
        key - the key of device info to add
        value - the value of device info to add
        Returns:
        the modified report
      • setGroupingHash

        public Report setGroupingHash​(java.lang.String groupingHash)
        Set the grouping hash on the report. Events will the same grouping hash will be grouped into the same error in Bugsnag. For use if custom grouping is required.
        Parameters:
        groupingHash - the grouping hash for the error report
        Returns:
        the modified report
      • setSeverity

        public Report setSeverity​(Severity severity)
        Set the severity to use in the report.
        Parameters:
        severity - the severity for the error report
        Returns:
        the modified report
      • setUser

        public Report setUser​(java.lang.String id,
                              java.lang.String email,
                              java.lang.String name)
        Helper method to set all the user attributes.
        Parameters:
        id - the identifier of the user.
        email - the email of the user.
        name - the name of the user.
        Returns:
        the modified report.
      • setUserId

        public Report setUserId​(java.lang.String id)
      • setUserEmail

        public Report setUserEmail​(java.lang.String email)
      • setUserName

        public Report setUserName​(java.lang.String name)
      • cancel

        public Report cancel()
      • getShouldCancel

        public boolean getShouldCancel()