Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: programatic minidump capture #1052

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event);
* This function allows for independently created minidumps to be captured.
PlasmaDev5 marked this conversation as resolved.
Show resolved Hide resolved
*/
SENTRY_API void sentry_capture_minidump(
const char *dump_path, sentry_value_t event, int removeDumpOnSend);
const char *dump_path, sentry_value_t event, int remove_dump_on_send);

/**
* Captures an exception to be handled by the backend.
Expand Down
10 changes: 4 additions & 6 deletions src/sentry_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ sentry_clear_crashed_last_run(void)

void
sentry_capture_minidump(
const char *dump_path, sentry_value_t event, int removeDumpOnSend)
const char *dump_path, sentry_value_t event, int remove_dump_on_send)
{
sentry_path_t *sentry_dump_path
= sentry__path_from_str_n(dump_path, strlen(dump_path));
Expand All @@ -1184,10 +1184,8 @@ sentry_capture_minidump(
}

SENTRY_WITH_OPTIONS (options) {
sentry_envelope_t *envelope
= NULL;
sentry__ensure_event_id(event, NULL);
envelope = sentry__envelope_new();
sentry_envelope_t *envelope = sentry__envelope_new();
if (!envelope || !sentry__envelope_add_event(envelope, event)) {
sentry_envelope_free(envelope);
sentry_value_decref(event);
Expand Down Expand Up @@ -1227,8 +1225,8 @@ sentry_capture_minidump(

sentry__capture_envelope(options->transport, envelope);

bool removeDumpOnSendBool = removeDumpOnSend;
if (removeDumpOnSendBool) {
bool remove_dump_on_send_bool = remove_dump_on_send;
if (remove_dump_on_send_bool) {
PlasmaDev5 marked this conversation as resolved.
Show resolved Hide resolved
sentry__path_remove(sentry_dump_path);
}

Expand Down
Loading