← All platforms

Rust error tracking

A panic should leave you something to go on. The Sentry Rust SDK sends the report to Telebugs on your server.

~/hoofnotes  cargo add sentry
~/hoofnotes  nvim src/main.rs
fn main() {
let _guard = sentry::init(
sentry::ClientOptions::new()
// Copy the complete DSN, key and path included.
.dsn("YOUR_TELEBUGS_DSN"),
);
// Remove this test once it appears in Telebugs.
panic!("Hello from Hoof Notes");
}
~/hoofnotes  cargo run

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

What about errors that aren’t panics?

Those belong here, too. Report an error with sentry::capture_error when you want to investigate it. An ordinary Result::Err doesn’t automatically become a report.

Will every panic make it through?

The SDK has a panic hook, but the process needs time to send the report. Normal unwinding allows that; an immediate abort may not. Telebugs receives what the SDK can deliver.