-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fix: Error message for GetResult handler #346
Conversation
🙈 |
/approve |
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.
/approve
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.
/kind bug
if err := errors.Wrap(gdb.Where(&db.Result{Parent: parent, Name: name}).First(r).Error); err != nil { | ||
return nil, status.Errorf(status.Code(err), "failed to query on database: %v", err) | ||
q := gdb. | ||
Where(&db.Result{Parent: parent, Name: name}). | ||
First(r) | ||
if err := errors.Wrap(q.Error); err != nil { | ||
return nil, 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.
Do we have a means of unit testing this error message?
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.
@sayan-biswas bump on this question.
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.
This errors are actually returned from the gorm package. In this repo we only have a wrapper. Untill we have a predefined set of error messages for all the RPCs, we can't create unit test to check the message string.
Fix Issue tektoncd#337, error message for GetResult handler.
ebe670f
to
76f3ed1
Compare
/release-note-none |
@adambkaplan ok to merge? |
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.
/lgtm
Added a release note - bug fixes should have release notes.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adambkaplan, alan-ghelardi, avinal, khrm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #337
Fix error message for GetResult handler.
Current: Shows wrapped RPC error message
{"code":5, "message":"failed to query on database: rpc error: code = NotFound desc = record not found", "details":[]}
Expected: Standard message
{"code":5, "message":"record not found", "details":[]}
Release Note