Skip to content

Conversation

@paulyufan2
Copy link
Contributor

PR description:

This PR is to fix:

(1) Replace ErrAPINotFound with UnsupportedAPI
(2) check err for client do()

@paulyufan2 paulyufan2 requested a review from a team as a code owner April 18, 2023 02:27
@paulyufan2 paulyufan2 requested review from rsagasthya and removed request for a team April 18, 2023 02:27
@ZetaoZhuang ZetaoZhuang enabled auto-merge (squash) April 18, 2023 04:10
@ZetaoZhuang ZetaoZhuang merged commit fec45f9 into master Apr 18, 2023
@ZetaoZhuang ZetaoZhuang deleted the cnsclientfixs branch April 18, 2023 18:28
Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashvindeodhar/@paulyufan/@ZetaoZhuang
making this an anonymous error is regressive and needs to be addressed in a follow up

if res.StatusCode == http.StatusNotFound {
return nil, &CNSClientError{
Code: types.UnsupportedAPI,
Err: errors.Errorf("Unsupported API"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • this error should be a typed error, not an anonymous error, so that it can be compared to with errors.Is/As
  • error strings should not be sentence-case ("unsupported API") because they are embedded within other strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants