Skip to content

Commit 9e585cb

Browse files
authored
Merge pull request #115 from joshdholtz/bugfix-114
Add breadcrumbs to uncaught exceptions
2 parents f239124 + edb70e9 commit 9e585cb

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ table below shows an example of what the data will look like in Sentry.
7070

7171
Version | Changes
7272
--- | ---
73+
**1.5.4** | Ensure that breadcrumbs are added to all exceptions. [#115](https://github.com/joshdholtz/Sentry-Android/issues/115).
7374
**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)).
7475
**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)).
7576
**1.5.1** | Revert accidental API removal of `captureException(Throwable, SentryEventLevel)`.

sentry-android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
apply plugin: 'com.android.library'
66

77

8-
def SentryAndroidVersion = "1.5.3"
8+
def SentryAndroidVersion = "1.5.4"
99

1010
android {
1111
compileSdkVersion 24

sentry-android/src/main/java/com/joshdholtz/sentry/Sentry.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public class Sentry {
8989
private static final String TAG = "Sentry";
9090
private final static String sentryVersion = "7";
9191
private static final int MAX_QUEUE_LENGTH = 50;
92-
private static final int MAX_BREADCRUMBS = 10;
9392

9493
public static boolean debug = false;
9594

@@ -519,6 +518,7 @@ public void uncaughtException(Thread thread, Throwable e) {
519518
// Here you should have a more robust, permanent record of problems
520519
SentryEventBuilder builder = new SentryEventBuilder(e, SentryEventLevel.FATAL);
521520
builder.setRelease(sentry.appInfo.versionName);
521+
builder.event.put("breadcrumbs", sentry.breadcrumbs.current());
522522

523523
if (sentry.captureListener != null) {
524524
builder = sentry.captureListener.beforeCapture(builder);
@@ -658,6 +658,10 @@ enum Type {
658658

659659
private static class Breadcrumbs {
660660

661+
// The max number of breadcrumbs that will be tracked at any one time.
662+
private static final int MAX_BREADCRUMBS = 10;
663+
664+
661665
// Access to this list must be thread-safe.
662666
// See GitHub Issue #110
663667
// This list is protected by the provided ReadWriteLock.

0 commit comments

Comments
 (0)