Checking in progress, though not fully working as expected

This commit is contained in:
Ryan Ward
2026-07-27 11:41:20 -05:00
parent 856a6cd6f3
commit 309000a303
51 changed files with 74 additions and 3315 deletions
+1 -32
View File
@@ -246,39 +246,8 @@ unsafe fn init_logging() {
// valid C string pointer.
let msg = unsafe { CStr::from_ptr(msg) };
let err_message = String::from_utf8_lossy(msg.to_bytes());
// Sentry shouldn't panic, but to be safe, make sure we don't unwind across the FFI
// boundary.
// Do not unwind across the FFI boundary.
let _ = panic::catch_unwind(|| {
// We report SQLite errors to Sentry in a more-structured format so that they have
// better grouping (all are under the same Sentry issue, with details for the specific
// error kind). Warning and debug SQLite messages are logged - with the default
// sentry_log configuration, warnings are added as breadcrumbs to other events and
// debug messages are ignored.
// In local builds without crash reporting, all SQLite messages get logged locally.
#[cfg(feature = "crash_reporting")]
if level == log::Level::Error {
sentry::with_scope(
|scope| {
let mut context = std::collections::BTreeMap::new();
context.insert("message".to_string(), err_message.into());
context.insert("code".to_string(), err_code.into());
context.insert(
"code_description".to_string(),
sqlite3::code_to_str(err_code).into(),
);
scope.set_context("sqlite", sentry::protocol::Context::Other(context));
},
|| {
sentry::capture_message(
"Sqlite Error",
sentry_log::convert_log_level(level),
)
},
);
return;
}
log::log!(
level,
"SQLite error {} ({}): {}",