Package com.bugsnag
Class Report
- java.lang.Object
-
- com.bugsnag.Report
-
public class Report extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Report(Configuration config, java.lang.Throwable throwable)
Create a report for the error.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Report
addToTab(java.lang.String tabName, java.lang.String key, java.lang.Object value)
Add a key value pair to a metadata tab.Report
cancel()
Report
clearTab(java.lang.String tabName)
Clear all of the keys from the given tab.protected java.lang.String
getApiKey()
Get the API key in the report.java.util.Map<java.lang.String,java.lang.Object>
getApp()
java.lang.String
getContext()
java.util.Map<java.lang.String,java.lang.Object>
getDevice()
java.lang.Throwable
getException()
java.lang.String
getExceptionMessage()
java.lang.String
getExceptionName()
protected java.util.List<com.bugsnag.Exception>
getExceptions()
Get the exceptions for the report.java.lang.String
getGroupingHash()
java.util.Map<java.lang.String,java.lang.Object>
getMetaData()
protected java.lang.String
getPayloadVersion()
java.lang.String
getSeverity()
boolean
getShouldCancel()
protected java.util.List<com.bugsnag.ThreadState>
getThreads()
java.util.Map<java.lang.String,java.lang.String>
getUser()
Report
setApiKey(java.lang.String apiKey)
Set the API key for the report.Report
setAppInfo(java.lang.String key, java.lang.Object value)
Deprecated.useaddToTab(String, String, Object)
insteadReport
setContext(java.lang.String context)
Set context of the report.Report
setDeviceInfo(java.lang.String key, java.lang.Object value)
Deprecated.useaddToTab(String, String, Object)
insteadvoid
setExceptionName(java.lang.String exceptionName)
Sets the class name from the exception contained in this error report.Report
setGroupingHash(java.lang.String groupingHash)
Set the grouping hash on the report.Report
setSeverity(Severity severity)
Set the severity to use in the report.Report
setUser(java.lang.String id, java.lang.String email, java.lang.String name)
Helper method to set all the user attributes.Report
setUserEmail(java.lang.String email)
Report
setUserId(java.lang.String id)
Report
setUserName(java.lang.String name)
-
-
-
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 tokey
- the key of the metadata to addvalue
- 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.useaddToTab(String, String, Object)
insteadAdd some application info on the report.- Parameters:
key
- the key of app info to addvalue
- 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.useaddToTab(String, String, Object)
insteadSet device information on the report.- Parameters:
key
- the key of device info to addvalue
- 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()
-
-