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

Improve candle_core::Error to make it more ergonomic #2467

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

EricLBuehler
Copy link
Member

Currently, our Error type is already useful but could benefit from some of the QoL features which the anyhow crate has.

This PR adds the following:

  • Make Error::msg more in line with anyhow::Error::msg. Although the type bound changes, this is not a breaking change because std::error::Error: Display already.
  • Add the Context trait. Inspired by anyhow's Context trait which allows for .with_context and .context on Options and Results. Very useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant