implement sentry transport to write crash reports to XDG_STATE_HOME

This commit is contained in:
Mitchell Hashimoto
2024-08-27 19:29:34 -07:00
parent e029490535
commit 2abdf291f4
5 changed files with 58 additions and 3 deletions

View File

@@ -7,4 +7,12 @@ pub const Envelope = opaque {
pub fn deinit(self: *Envelope) void {
c.sentry_envelope_free(@ptrCast(self));
}
pub fn writeToFile(self: *Envelope, path: []const u8) !void {
if (c.sentry_envelope_write_to_file_n(
@ptrCast(self),
path.ptr,
path.len,
) != 0) return error.WriteFailed;
}
};