-
Notifications
You must be signed in to change notification settings - Fork 12
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
Formatting: Simple multi-error format #74
Comments
+1 on formatting customization options. I'd also like to experiment with an option to deduplicate the error messages in the tree for common uses of |
So here's my thinking: I propose that we change Format and FormatString to do empty-line-separated errors for multi-errors.
And the trace for a multi-error is:
This matches the simplicity of If anyone actually finds the tree functionality useful, we can put it in a FormatTree function. Thoughts? Edit: Update:
The above case looks better if we don't print the multi-error itself (which makes sense since we're traversing its children), but it loses information if there was a trace leading up to the multi-error. |
Example from playing around: Flat:
Tree:
|
The tree output format should be opt-in, and we should default to just empty-line-separated leaf errors.
For leaf errors, multi-error parent just provides an additional piece of the error trace, so there will be some repetition of frames between those errors.
This also ties into #71: we can expose a simple iterator
func(error, []frame)
with the understanding that parent/child relationships don't need to be exposed.The text was updated successfully, but these errors were encountered: