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

deps: enable the backtrace feature by default #362

Merged
merged 4 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Breaking Changes**:

- The `backtrace` feature of `sentry-anyhow` is enabled by default. ([362](https://github.com/getsentry/sentry-rust/pull/362))

## 0.23.0

**Breaking Changes**:
Expand Down
1 change: 1 addition & 0 deletions sentry-anyhow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Sentry integration for anyhow.
edition = "2018"

[features]
default = ["backtrace"]
backtrace = ["anyhow/backtrace"]

[dependencies]
Expand Down
36 changes: 26 additions & 10 deletions sentry-anyhow/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<p align="center">
<a href="https://sentry.io" target="_blank" align="center">
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
</a>
</p>
# sentry-anyhow

# Sentry Rust SDK: sentry-anyhow
Adds support for capturing Sentry errors from [`anyhow::Error`].

Adds support for capturing Sentry errors from `anyhow::Error`.
This integration adds a new event *source*, which allows you to create events directly
from an [`anyhow::Error`] struct. As it is only an event source it only needs to be
enabled using the `anyhow` cargo feature, it does not need to be enabled in the call to
[`sentry::init`](https://docs.rs/sentry/*/sentry/fn.init.html).

This integration does not need to be installed, instead it provides an extra function to
capture [`anyhow::Error`], optionally exposing it as a method on the
[`sentry::Hub`](https://docs.rs/sentry/*/sentry/struct.Hub.html) using the
[`AnyhowHubExt`] trait.

Like a plain [`std::error::Error`] being captured, [`anyhow::Error`] is captured with a
chain of all error sources, if present. See
[`sentry::capture_error`](https://docs.rs/sentry/*/sentry/fn.capture_error.html) for
details of this.

## Example

Expand All @@ -22,9 +31,16 @@ if let Err(err) = function_that_might_fail() {
}
```

## Resources
## Features

License: Apache-2.0
The `backtrace` feature will enable the corresponding feature in anyhow and allow you to
capture backtraces with your events. It is enabled by default.

## Resources

- [Discord](https://discord.gg/ez5KZN7) server for project discussions.
- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates
- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates.

[`anyhow::Error`]: https://docs.rs/anyhow/*/anyhow/struct.Error.html

License: Apache-2.0
10 changes: 10 additions & 0 deletions sentry-anyhow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
//! }
//! ```
//!
//! # Features
//!
//! The `backtrace` feature will enable the corresponding feature in anyhow and allow you to
//! capture backtraces with your events. It is enabled by default.
//!
//! # Resources
//!
//! - [Discord](https://discord.gg/ez5KZN7) server for project discussions.
//! - Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates.
//!
//! [`anyhow::Error`]: https://docs.rs/anyhow/*/anyhow/struct.Error.html

#![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")]
Expand Down