-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Enhancement for format error message #129
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. I'm expecting to see we can can use this error handler to cover all the places of parsing YAML file.
Path: filepath, | ||
ErrorMsg: errorMsg, | ||
} | ||
if testErr != expectErr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using expectErr
as a YamlFormatError, can you use an expected error message?
expected := "some expected error message"
if testErr.Error() != expected {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -119,7 +120,7 @@ func NewResourceSliceFromPatches( | |||
|
|||
res, err := newResourceSliceFromBytes(content) | |||
if err != nil { | |||
return nil, err | |||
return nil, internal.ErrorHandler(err, path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be other places we parse YAML files and catch the error. Can you also apply this error handler for them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
f1a9bf4
to
ef57f40
Compare
` | ||
) | ||
|
||
//type foo struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this line to the bottom?
- add yaml format error handler - silent usage when build command fails
Improve error message on YAML format errors #114