Skip to content

Commit

Permalink
Merge pull request #115 from joshdholtz/bugfix-114
Browse files Browse the repository at this point in the history
Add breadcrumbs to uncaught exceptions
  • Loading branch information
marcomorain authored Feb 1, 2017
2 parents f239124 + edb70e9 commit 9e585cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ table below shows an example of what the data will look like in Sentry.

Version | Changes
--- | ---
**1.5.4** | Ensure that breadcrumbs are added to all exceptions. [#115](https://github.com/joshdholtz/Sentry-Android/issues/115).
**1.5.3** | Fix thread-safety bug when serializing breadcrumbs. [#110](https://github.com/joshdholtz/Sentry-Android/issues/110) (thanks to [fab1an](https://github.com/fab1an)).
**1.5.2** | Send stack-frames to Sentry in the correct order. [#95](https://github.com/joshdholtz/Sentry-Android/pull/95).<br/> Use the [versionName](https://developer.android.com/studio/publish/versioning.html#appversioning), rather than versionCode, as the default value for the release field of events (thanks to [FelixBondarenko](https://github.com/FelixBondarenko)).
**1.5.1** | Revert accidental API removal of `captureException(Throwable, SentryEventLevel)`.
Expand Down
2 changes: 1 addition & 1 deletion sentry-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
apply plugin: 'com.android.library'


def SentryAndroidVersion = "1.5.3"
def SentryAndroidVersion = "1.5.4"

android {
compileSdkVersion 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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 @@ -519,6 +518,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 @@ -658,6 +658,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 9e585cb

Please sign in to comment.