|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.analytics.tracking.android.StandardExceptionParser
public class StandardExceptionParser
This class will capture the root cause (last in a chain of causes) Throwable
and report the exception type, class name, method name and thread
name.
This class will attempt to report a class and method name that is relevant to
the application if at all possible. It does this by finding the root cause
Throwable
, then checking each StackTraceElement
for a class
that is in a package list created by setIncludedPackages(Context, java.util.Collection
, starting
with the first StackTraceElement
.
The String
returned by getDescription(java.lang.Throwable, java.lang.StackTraceElement, java.lang.String)
will take on the form
Exception class(@classname:methodname){threadname}.
See getBestStackTraceElement(java.lang.Throwable)
and setIncludedPackages(Context, java.util.Collection
for
details.
Constructor Summary | |
---|---|
StandardExceptionParser(Context context,
java.util.Collection<java.lang.String> additionalPackages)
|
Method Summary | |
---|---|
java.lang.String |
getDescription(java.lang.String threadName,
java.lang.Throwable t)
Return a short description of a Throwable suitable for
reporting to Google Analytics. |
void |
setIncludedPackages(Context context,
java.util.Collection<java.lang.String> additionalPackages)
Sets the list of packages considered relevant to the list of packages in the Context and the list of packages provided in the
input parameter additionalPackages . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardExceptionParser(Context context, java.util.Collection<java.lang.String> additionalPackages)
Method Detail |
---|
public void setIncludedPackages(Context context, java.util.Collection<java.lang.String> additionalPackages)
Context
and the list of packages provided in the
input parameter additionalPackages
. Either parameter can be null.
Any package names stored from a previous call to this method will be cleared.
context
- any Context
for the applicationadditionalPackages
- a collection of additional package names to addpublic java.lang.String getDescription(java.lang.String threadName, java.lang.Throwable t)
ExceptionParser
Throwable
suitable for
reporting to Google Analytics.
getDescription
in interface ExceptionParser
threadName
- the name of the Thread
that got the exception, or nullt
- the Throwable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |