miette
miette copied to clipboard
Fancy extension for std::error::Error with pretty, detailed diagnostic printing.
The fact that a `Diagnostic` can be printed to terminal by debug printing a `Report` from it is super useful and a nice trick for messing around with Miette. It...
Noticed that sometimes miette is missing lines in the panic when you use Miette's custom handler. Here's one example: Miette: ``` × Main thread panicked. ├─▶ at crates/nu-protocol/src/engine/stack.rs:46:9 ╰─▶ variable...
```rust use miette::{Diagnostic, SourceSpan}; use thiserror::Error; #[derive(Error, Debug, Diagnostic)] #[error("oops!")] #[diagnostic( code(oops::my::bad), url(docsrs), help("try doing it better next time?") )] struct MyBad { // The Source that we're gonna be...
When you get a (very nice looking) miette error you get two trailing newlines, rather than just one. This is causing me some head scratching moments with testing error outputs...
When running `cargo test` without `--features fancy`, one of the tests in `README.md` fails: ``` failures: ---- src/lib.rs - (line 386) stdout ---- error[E0433]: failed to resolve: could not find...
Suppose I'm rendering a type error that involves some large/gnarly types. Ideally, I'd like to format/pretty-print those types over multiple lines to make them readable. But afaict this isn't something...
converting `impl Error` to `Diagnostic` implicitly when using with_err or cascading error using `?`
When using miette, I have this sort of code a lot: ```rust use miette::{WithErr, Result}; fn main() -> Result { // do_stuff returns a `Result` where E implements the `Error`...
I'm implementing `Diagnostic` manually for an error type so that it can provide different labels depending on the nature of the error. While testing, I noticed this report, which seems...
This is going to be **hard**, but it's going to make out-of-the-box display for, say, a bunch of single-line json, a lot easier.
Only enable this when the user asks for it, tho