Open oovm opened 1 year ago
As I kind of eluded to in my longer comment on #78, I don't feel that ariadne should cover this case. The crate is intended to convert errors with an existing structure defined by the crate user and turn them into a pretty output. You can think of ariadne like a markdown-to-PDF converter, or a browser layout engine that ingests HTML and spits out the image you see on the screen. Interpreting information that is neither textual nor structural (std::io::Error
is neither) falls outside the scope of the crate.
That said, I would like to see some way to incorporate ordered elements like a backtrace, but I'd prefer to do this in a more generic way that adapts to users needs better (like HTML's <li>
list tag) rather than something that's specifically intended for backtraces. I admit that this will require a lot more work on the crate's internals to get there though.
In this case, we need a mechanism to append information to the report.
Now we've handled textual errors pretty well, but there's another non-textual case, like runtime errors, #50, #72.
I think it can be solved by adding
Caused by
.For example, IO Error should be
Other runtime errors can be:
Are there any other suggestions?
This is not about compatibility, can I submit a PR for this feature?