Closed gluax closed 8 months ago
https://github.com/zkat/miette?tab=readme-ov-file#-snippets you need to use labels
Ah, I see, thank you!!
So I can't attach multiple instances of arbitrary text(Strings/&'static str/etc) to be printed out, or have the code be dynamically set from a field?
Correct. You always need SourceCode + at least one label. But you can have a single label that's the span of your entire arbitrary string, if you want. Miette can do multiline spans
Hey all,
I'm trying to leverage
miette
's pretty printing withthiserror
.But I run into the case where when an error bubbles up, it only displays what's written in the error proc macro for an enum, and it doesn't display the source code blocks or anything.
Example
Produces an error like this, not printing the
source_code
block at all:I tried looking at the readme and other examples, but cannot figure out why this is the case.
Can someone explain how to make this work with
thiserror
?