-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Unify and improve error reporting #35
Comments
This would probably break API (the error reporter will be replaced with error formatter). |
I expect have summary report page. |
See also #62 and #35. |
I would be happy to help! |
@goku321 Great, you're welcome! Please also take a look at these issues: #42, #59, #62. They're related enough. It would be nice to do refactoring with those issues in mind. We can not only add report struct, but also add context struct, and pass both of them to error formatter. So I suggest the following:
We first can introduce some minimal context, report, and formatter, and merge it. The we can incrementally add more info to context and reporter and improve formatter. And after implementing this, we'll also be able to resolve the issues I linked above. Formatter should be an interface to allow the user to substitute it. We should provide a default implementation, e.g. DefaultFormatter. We should allow the user to specify custom formatter via Config, and use default one if it's not specified. BTW, This way we will not break the API. |
@gavv Thank you for the elaboration. I'll start with the issues you mentioned to get a better understanding. |
Closing with respect to #69. |
@goku321 Are you still interested? I've prepared a more detail issue (linked above). |
@gavv Yes, I am. But I can only start working on this from next week(if that's okay) as I am caught up with some stuff. |
Unify error formatting
Currently, every component do its own error message formatting. Instead, all of them should fill a struct with error info and pass it to error formatter, which will format it as text and pass to error reporter. The user can provide their own error formatter.
Improve error messages
The error message should include:
Use colored output
When running in a TTY, use colors for error message and diff (gojsondiff allows that). The user can enable, disable, or choose an automatic mode for this.
The text was updated successfully, but these errors were encountered: