sentry-rust
sentry-rust copied to clipboard
Unnamed event
Environment
Windows 10, Mac OS Sentry 0.27
Steps to Reproduce
I use the following function to send crash dump. Everything works great except all events have the same name - < unnamed >
pub fn send_crash_dump(crash_dump: &PathBuf) {
with_scope(
|scope| {
let filename = format!(
"{:}.dmp",
crash_dump
.parent()
.unwrap()
.file_name()
.unwrap()
.to_os_string()
.into_string()
.unwrap()
);
scope.add_attachment(Attachment {
ty: Some(AttachmentType::Minidump),
buffer: std::fs::read(crash_dump.as_path()).unwrap(),
filename,
content_type: None,
})
},
|| {
let crash_info = crash_dump
.file_name()
.unwrap()
.to_os_string()
.into_string()
.unwrap();
let event = Event {
exception: vec![Exception {
ty: "native unhandled exception".into(),
mechanism: Some(Mechanism {
ty: "native crash handler".into(),
handled: Some(false),
..Default::default()
}),
value: Some(format!("Unhandled exception. {}", &crash_info)),
..Default::default()
}]
.into(),
message: Some(format!("Unhandled exception. {}", &crash_info)),
level: Level::Fatal,
..Default::default()
};
let confirm_uuid = sentry::capture_event(event);
if confirm_uuid == Uuid::nil() {
println!("failed to capture native event");
}
},
);
}
Expected Result
Event has 'Unhandled exception...' name
Actual Result
Event has < unnamed > name
Why are you manually constructing the exception and message?
When you supply a minidump Sentry pulls these from the minidump.
Why are you manually constructing the exception and message?
In the project I work on there are some third party native libraries and crash can occur in some of those. So I setup a global unhandled exception handler where I create a dump and manually create exception and message objects.
Is there a better approach for the problem? If so could you please share.
When you supply a minidump Sentry pulls these from the minidump.
By any chance do you know how to setup it in minidump?
To differentiate between different sources of errors I think it's recommended to use tags.
configure_scope(|scope| {
scope.set_tag("source", "lib-bad");
});
When you supply a minidump Sentry pulls these from the minidump.
@timfish by any chance do you know what property it looks for the name?