-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Enrich the error returned from Request.Watch method #126265
Conversation
/retest |
The Error method of the error returned from Request.Watch was "unknown" even the server returned clear message in the Status struct. It was because Request.Watch used the Result's err member directly, which is an unstructured error from the response which the Result object may use if the caller did not return a structured error. The patch fixes it by calling the Result's Error method instead, which returns the structured error when it's present. It also removes the wrong expectation about events.
/triage accepted |
@liggitt could you please take another look? |
/lgtm |
LGTM label has been added. Git tree hash: 1fc4936b6b01cf734a51d56d43a8a828e381f73c
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, tnqn 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The
Error
method of the error returned fromRequest.Watch
was "unknown" even the server returned clear message in theStatus
struct. It was becauseRequest.Watch
used theResult
'serr
member directly, which is an unstructured error from the response which theResult
object may use if the caller did not return a structured error.The patch fixes it by calling the
Result
'sError
method instead, which returns the structured error when it's present.It also removes a duplicate test case and remove the wrong expectation about events.
Testing with the following code:
Before:
After:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: