dapr icon indicating copy to clipboard operation
dapr copied to clipboard

Error Standardization: Metadata API

Open cicoyle opened this issue 1 year ago • 3 comments

Richer errors in Dapr for the Metadata API.

Note: Please clone this issue and assign the clone of this issue to yourself if you would like to contribute to the error standardization efforts.

Scope of work

  • [ ] Choose 5-10 errors in the Metadata API to enrich. Ideally, cover as many errors as possible from the API.
  • [ ] Follow the steps outlined in this README for each error being updated

Definition of done

  • [ ] Update 5-10 errors in the Metadata API
  • [ ] Update the unit tests, if necessary
  • [ ] Write integration tests to cover each updated errors

Keep in mind

Unless a major version is being released and there is a solid reason for introducing backwards incompatibility, we can't change the API, meaning the HTTP and gRPC status codes, and the error codes must stay the same. An exception to this is the gRPC StatusCode.UNKNOWN which should be converted to a specific status.

See the kit errors pkg README for another usage example. For each error being updated, you can use the following helper functions to add error details, see the kit errors pkg for more details:

  • WithHelpLink()
  • WithHelp()
  • WithErrorInfo() - Required
  • WithFieldViolation()
  • WithDetails()

Reference PRs

Existing error standardization for:

cicoyle avatar Feb 02 '24 19:02 cicoyle

I would like to work on this issue can you guide me on how to get started with this to solve the issue

Bharadwajshivam28 avatar Feb 05 '24 10:02 Bharadwajshivam28

Hey @Bharadwajshivam28 - sure thing! 🙂

First, I suggest copying this issue into a new one, and assigning that issue to yourself. From there, I would choose the Metadata API errors that you might have seen before. You'll want to create a new metadata.go file to construct your errors in, similar to how I made a pubsub.go errors file here in my PR. Once you have updated a few Metadata API errors using the newly constructed ones, run the unit tests, see if you need to tweak anything, then write some integration tests to force those errors you updated.

You should be able to directly reference my PubSub PR for a good baseline of the changes involved.

LMK if you have any additional questions. I'm happy to help!

cicoyle avatar Feb 05 '24 14:02 cicoyle

Thanks for it @cicoyle I am looking in it

Bharadwajshivam28 avatar Feb 05 '24 15:02 Bharadwajshivam28