Package com.rollbar.jvmti
Class ThrowableCache
java.lang.Object
com.rollbar.jvmti.ThrowableCache
ThrowableCache is a mechanism for storing information from the native interface at the time
of an exception which can be queried later by the notifier for enhancing payloads.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(Throwable throwable, CacheFrame[] frames) Add a list of frames with extra information to the cache associated to this particular throwable.static voidaddAppPackage(String newAppPackage) Add a string representing a package prefix to check against class names in stack traces to determine whether to cache throwables or not.static CacheFrame[]Get the cached frames associated with the given throwable.static booleanshouldCacheThrowable(Throwable throwable, int numFrames) Whether or not we should cache this throwable which has a particular number of frames in its stacktrace.
-
Method Details
-
add
Add a list of frames with extra information to the cache associated to this particular throwable.- Parameters:
throwable- a throwable to use as a cache key.frames- frames associated with this throwable.
-
get
Get the cached frames associated with the given throwable.- Parameters:
throwable- a throwable to use as a cache key.- Returns:
- the list of frames previously cached or null.
-
shouldCacheThrowable
Whether or not we should cache this throwable which has a particular number of frames in its stacktrace.- Parameters:
throwable- the throwable we might want to cache.numFrames- the number of frames in the stacktrace.- Returns:
- true if we should gather info about this throwable and cache it.
-
addAppPackage
Add a string representing a package prefix to check against class names in stack traces to determine whether to cache throwables or not.- Parameters:
newAppPackage- a string to add to the set of packages in your app.
-