Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/android/io/sentry/SentryCordova.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
try (FileOutputStream out = new FileOutputStream(installation)) {
out.write(bytes);
logger.info("Successfully captured envelope.");
callbackContext.success();
} catch (Exception e) {
logger.info("Error writing envelope.");
callbackContext.error("Error writing envelope.");
}

break;
Expand Down Expand Up @@ -369,8 +371,10 @@ private void addBreadcrumb(final JSONObject jsonBreadcrumb, final CallbackContex

scope.addBreadcrumb(breadcrumb);
logger.info("Send breadcrumb successful");
callbackContext.success();
} catch (JSONException e) {
logger.warning("Error deserializing breadcrumb");
callbackContext.error("Failed to add breadcrumb");
}
});
}
Expand Down
24 changes: 24 additions & 0 deletions src/ios/SentryCordova.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,20 @@ - (void)addBreadcrumb:(CDVInvokedUrlCommand *)command {

[scope addBreadcrumb:breadcrumbInstance];
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)clearBreadcrumbs:(CDVInvokedUrlCommand *)command {
[SentrySDK configureScope:^(SentryScope *_Nonnull scope) {
[scope clearBreadcrumbs];
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)setUser:(CDVInvokedUrlCommand *)command {
Expand Down Expand Up @@ -242,6 +250,10 @@ - (void)setUser:(CDVInvokedUrlCommand *)command {
[scope setUser:userInstance];
}
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)setExtra:(CDVInvokedUrlCommand *)command {
Expand All @@ -251,6 +263,10 @@ - (void)setExtra:(CDVInvokedUrlCommand *)command {
[SentrySDK configureScope:^(SentryScope *_Nonnull scope) {
[scope setExtraValue:extra forKey:key];
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)setContext:(CDVInvokedUrlCommand *)command {
Expand All @@ -260,6 +276,10 @@ - (void)setContext:(CDVInvokedUrlCommand *)command {
[SentrySDK configureScope:^(SentryScope *_Nonnull scope) {
[scope setContextValue:context forKey:key];
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)setTag:(CDVInvokedUrlCommand *)command {
Expand All @@ -269,6 +289,10 @@ - (void)setTag:(CDVInvokedUrlCommand *)command {
[SentrySDK configureScope:^(SentryScope *_Nonnull scope) {
[scope setTagValue:value forKey:key];
}];

CDVPluginResult *result =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:YES];
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}

- (void)crash:(CDVInvokedUrlCommand *)command {
Expand Down
Loading