-
Notifications
You must be signed in to change notification settings - Fork 110
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
refactor: use warning for invalid protocols in yarn.lock #207
refactor: use warning for invalid protocols in yarn.lock #207
Conversation
pkg/nodejs/yarn/parse.go
Outdated
// in case an unsupported protocol is detected | ||
// show warning and continue parsing | ||
if err != nil { | ||
log.Logger.Warnf(err.Error()) |
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.
log.Logger.Warnf(err.Error()) | |
log.Logger.Warnf("Yarn protocol error: %s", err) |
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
pkg/nodejs/yarn/parse.go
Outdated
return Library{}, nil, -1, xerrors.Errorf("failed to parse package pattern: '%s', unknown protocol: '%s'", line, protocol) | ||
// we need to calculate the last line of the block in order to correctly determine the line numbers of the next blocks | ||
// store the error. we will handle it later | ||
err = xerrors.Errorf("failed to parse package pattern: '%s', unknown protocol: '%s'", line, protocol) |
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.
err = xerrors.Errorf("failed to parse package pattern: '%s', unknown protocol: '%s'", line, protocol) | |
err = xerrors.Errorf("unknown protocol: '%s', line: %s", protocol, line) |
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
Description
We currently stop parsing if invalid protocol is found.
We need to show warning and continue parsing in these cases.