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

Support Caused by #77

Open
oovm opened this issue Jun 2, 2023 · 3 comments
Open

Support Caused by #77

oovm opened this issue Jun 2, 2023 · 3 comments

Comments

@oovm
Copy link

oovm commented Jun 2, 2023

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

[E001] Error: File Not Found

Caused by:
      path/of/files

Other runtime errors can be:

[E002] Error: Runtime error, reasons...

Caused by:
      path/of/call_site1(line:col)
      path/of/call_site2(line:col)
      path/of/call_site3(line:col)

Are there any other suggestions?

This is not about compatibility, can I submit a PR for this feature?

@zesterer
Copy link
Owner

zesterer commented Jun 2, 2023

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.

@oovm
Copy link
Author

oovm commented Jun 2, 2023

In this case, we need a mechanism to append information to the report.

@zesterer
Copy link
Owner

zesterer commented Jun 2, 2023

The current way to do that is with_note, but I want to expand this out further.

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

No branches or pull requests

2 participants