Skip to content
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

Add error code and category funcs #109

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

jake-engelberg
Copy link
Contributor

Description

In order to support error code metrics, sometimes the category will need to be passed along with a kit error, as well as the ability to retrieve it and its error code.

Issue reference

Please reference the issue this PR will close: dapr/proposals#67

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests

Copy link
Contributor

@elena-kolevska elena-kolevska left a comment

Choose a reason for hiding this comment

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

Can you please add a unit test for ErrorCode() ?
Also, if I remember correctly, we should be checking if the tag field has a value first, before checking ErrorInfo.

errors/errors.go Outdated Show resolved Hide resolved
@jake-engelberg
Copy link
Contributor Author

Can you please add a unit test for ErrorCode() ? Also, if I remember correctly, we should be checking if the tag field has a value first, before checking ErrorInfo.

Added testing for ErrorCode().

Also, I've added the prioritization of tag in the ErrorCode() method itself rather than the ConvertErrorDetails() method, if you think I should move it in there lmk.

Copy link
Contributor

@elena-kolevska elena-kolevska left a comment

Choose a reason for hiding this comment

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

Great work!
We ended up doing the check for the legacy tag twice (you had it right the first time), but that's ok, I don't want to delay this PR.

@artursouza artursouza merged commit 30e2c24 into dapr:main Nov 27, 2024
6 checks passed
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.

5 participants