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

How to manually collect and print errors #256

Closed
NicholasLYang opened this issue Apr 28, 2023 · 2 comments
Closed

How to manually collect and print errors #256

NicholasLYang opened this issue Apr 28, 2023 · 2 comments

Comments

@NicholasLYang
Copy link

I'm trying to use miette for a compiler, where I'd want to collect a whole bunch of errors and display them all at once. From reading the docs, it seems like I can add related errors to a top level error type, but is there a way to just manually print a vector of error types?

Thanks!

@zkat
Copy link
Owner

zkat commented Apr 28, 2023

The easiest way to "manually" print a Diagnostic is to wrap it in a Report and then print it with {:?}. Then you can print things however you want. Related errors are mostly a convenience but they're very narrowly useful

@NicholasLYang
Copy link
Author

Gotcha. Thanks so much!

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