Skip to content

Commit

Permalink
Add breadcrumbs to uncaught exceptions
Browse files Browse the repository at this point in the history
Fixes #114
  • Loading branch information
marcomorain committed Feb 1, 2017
1 parent 6b70d34 commit 4ea5cdc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public class Sentry {
private static final String TAG = "Sentry";
private final static String sentryVersion = "7";
private static final int MAX_QUEUE_LENGTH = 50;
private static final int MAX_BREADCRUMBS = 10;

public static boolean debug = false;

Expand Down Expand Up @@ -517,6 +516,7 @@ public void uncaughtException(Thread thread, Throwable e) {
// Here you should have a more robust, permanent record of problems
SentryEventBuilder builder = new SentryEventBuilder(e, SentryEventLevel.FATAL);
builder.setRelease(sentry.appInfo.versionName);
builder.event.put("breadcrumbs", sentry.breadcrumbs.current());

if (sentry.captureListener != null) {
builder = sentry.captureListener.beforeCapture(builder);
Expand Down Expand Up @@ -656,6 +656,10 @@ enum Type {

private static class Breadcrumbs {

// The max number of breadcrumbs that will be tracked at any one time.
private static final int MAX_BREADCRUMBS = 10;


// Access to this list must be thread-safe.
// See GitHub Issue #110
// This list is protected by the provided ReadWriteLock.
Expand Down

0 comments on commit 4ea5cdc

Please sign in to comment.