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

fix: don't fail crashpad startup on invalid DSN #1059

Merged
merged 8 commits into from
Oct 24, 2024
Merged
Changes from 3 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
16 changes: 7 additions & 9 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,23 +434,21 @@ crashpad_backend_startup(
// `sentry_init` will persist the upload flag.
data->db = crashpad::CrashReportDatabase::Initialize(database).release();
data->client = new crashpad::CrashpadClient;
bool success;
char *minidump_url
= sentry__dsn_get_minidump_url(options->dsn, options->user_agent);
if (minidump_url) {
SENTRY_TRACEF("using minidump URL \"%s\"", minidump_url);
success = data->client->StartHandler(handler, database, database,
minidump_url, options->http_proxy ? options->http_proxy : "",
annotations, arguments,
/* restartable */ true,
/* asynchronous_start */ false, attachments);
sentry_free(minidump_url);
} else {
SENTRY_WARN(
"failed to construct minidump URL (check DSN or user-agent)");
crashpad_state_dtor(data);
return 1;
}
JoshuaMoelans marked this conversation as resolved.
Show resolved Hide resolved
const std::string url
= minidump_url ? std::string(minidump_url) : std::string();
sentry_free(minidump_url);
bool success = data->client->StartHandler(handler, database, database, url,
options->http_proxy ? options->http_proxy : "", annotations, arguments,
/* restartable */ true,
/* asynchronous_start */ false, attachments);
JoshuaMoelans marked this conversation as resolved.
Show resolved Hide resolved

#ifdef SENTRY_PLATFORM_WINDOWS
crashpad_register_wer_module(absolute_handler_path, data);
Expand Down
Loading