Skip to content

Commit 67e5d9f

Browse files
committed
update before_send docs
1 parent 6e918af commit 67e5d9f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/platforms/native/common/configuration/filtering.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Note also that breadcrumbs can be filtered, as discussed in [our Breadcrumbs doc
2424

2525
#### Event Hints
2626

27-
The <PlatformIdentifier name="before-send" /> callback is passed both the `event` and a second argument, `hint`, that holds one or more hints.
27+
The <PlatformIdentifier name="before-send" /> callback is passed the `event`, a second argument `hint` and lastly custom `user_data`.
2828

2929
Typically, a `hint` holds the original exception so that additional data can be extracted or grouping is affected. In this example, the fingerprint is forced to a common value if an exception of a certain type has been caught:
3030

platform-includes/configuration/before-send-hint/native.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Alert>
22

3-
The Native SDK does not pass exception information into the hint, but instead allows to set a custom hint in SDK options. To detect the exception type, inspect the event instead.
3+
The Native SDK does not pass exception information into the hint, but instead allows to set custom user data in the `before_send` SDK option. To detect the exception type, inspect the event instead.
44

55
</Alert>
66

77
```c
88
#include <string.h>
99
#include <sentry.h>
1010

11-
sentry_value_t before_send(sentry_value_t event, void *hint) {
11+
sentry_value_t before_send(sentry_value_t event, void *hint, void *user_data) {
1212
/* sentry_value_t functions handle NULL automatically */
1313
sentry_value_t exceptions = sentry_value_get_by_key(event, "exception");
1414
sentry_value_t values = sentry_value_get_by_key(exceptions, "values");
@@ -17,7 +17,7 @@ sentry_value_t before_send(sentry_value_t event, void *hint) {
1717
const char *type_str = sentry_value_as_string(type);
1818

1919
/* use the data passed during initialization */
20-
const char *custom_error = (const char *)hint;
20+
const char *custom_error = (const char *)user_data;
2121

2222
if (type_str && strcmp(type_str, custom_error) == 0) {
2323
sentry_value_t fingerprint = sentry_value_new_list();

0 commit comments

Comments
 (0)