-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support user-facing BuildPlanner errors #2719
Conversation
|
||
func ProcessCommitError(commit *Commit, fallbackMessage string) error { | ||
if commit.Error == nil { | ||
return errs.New(fallbackMessage) |
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.
Is this a scenario that we expect to happen? We might want to present something localized if that's the case.
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.
No, if this happens we've encountered an error type but the message wasn't set which would be an invalid according to the build planner's schema.
} | ||
|
||
return b.Commit.CommitID, nil | ||
return errs.New(fallbackMessage) |
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.
We don't want to silence this one (input 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.
In this case, if we have to use the fallback message we've encountered an error type that we aren't handling so we should update these functions.
Co-authored-by: Nathan Rijksen <[email protected]>
While working on this PR, a better way to handle the various error types coming from the BuildPlanner surfaced. This PR updates our error handling in this regard.