From edceaf6ea6838ece2f8adc5a60c17c00ec42b072 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Sun, 3 Jun 2018 23:59:36 -0700 Subject: [PATCH] fix: Propagate the crash even on failure (#417) --- android/src/main/java/io/sentry/RNSentryModule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/sentry/RNSentryModule.java b/android/src/main/java/io/sentry/RNSentryModule.java index e6aeb8ace1..e5f176f9dc 100644 --- a/android/src/main/java/io/sentry/RNSentryModule.java +++ b/android/src/main/java/io/sentry/RNSentryModule.java @@ -109,7 +109,10 @@ public void startWithDsnString(String dsnString, final ReadableMap options, Prom sentryClient.addEventSendCallback(new EventSendCallback() { @Override public void onFailure(Event event, Exception exception) { - + // This needs to be there, otherwise in case of not internet the users app will not + // crash since we do not propagate the error further. + RNSentryEventEmitter.sendEvent(reactContext, RNSentryEventEmitter.SENTRY_EVENT_STORED, new WritableNativeMap()); + RNSentryEventEmitter.sendEvent(reactContext, RNSentryEventEmitter.SENTRY_EVENT_SENT_SUCCESSFULLY, new WritableNativeMap()); } @Override