http-rs / http-rs/http-types

Proposal: Switch http-types::error::Error.error from anyhow to eyre

Open
#214 9 comments 2 reactions 0 assignees View on GitHub
semver-major
Dominant language
Rust
Stars
209
Forks
91
PR merge metrics
No merged PRs in 30d

Description

https://lib.rs/crates/eyre is a fork of anyhow that uses the https://lib.rs/crates/backtrace instead of std::backtrace::Backtrace. the backtrace crate currently provides a much better interface than std::backtrace::Backtrace for programmatic interaction (iterating over frames, for example, allowing for backtrace filtering)

This is important for a web framework because the framework can provide a highly usable in-browser interface to understand errors. Here's an example from the phoenix framework:
![image](https://user-images.githubusercontent.com/13301/89449788-6f987d80-d70e-11ea-9a63-ade7ee3124e2.png)

In development mode, they render a relevant snippet of code and a backtrace annotated with filesystem locations. IIRC, clicking any of those stack frames jumps to that line, syntax highlighted, in browser. This is obviously way beyond what http-types, rust, and tide can currently offer, but switching to eyre and the backtrace crate would allow us to take further steps in that direction.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.