crash: beforeSend needs to add contexts to the event directly

This commit is contained in:
Mitchell Hashimoto
2024-09-02 09:55:47 -07:00
parent d499f7795b
commit d8cc19612f
2 changed files with 33 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ pub const Value = struct {
}
/// sentry_value_set_by_key_n
pub fn setByKey(self: Value, key: []const u8, value: Value) void {
pub fn set(self: Value, key: []const u8, value: Value) void {
_ = c.sentry_value_set_by_key_n(
self.value,
key.ptr,
@@ -61,4 +61,15 @@ pub const Value = struct {
value.value,
);
}
/// sentry_value_set_by_key_n
pub fn get(self: Value, key: []const u8) ?Value {
const val: Value = .{ .value = c.sentry_value_get_by_key_n(
self.value,
key.ptr,
key.len,
) };
if (val.isNull()) return null;
return val;
}
};