Add unit tests for custom error types#289
Add unit tests for custom error types#289GautamBytes wants to merge 1 commit intoopenkruise:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@hantmac please review it whenever feasible! |
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
b3baa3c to
1d9cbc8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #289 +/- ##
==========================================
+ Coverage 47.52% 47.65% +0.12%
==========================================
Files 63 64 +1
Lines 9799 9823 +24
==========================================
+ Hits 4657 4681 +24
Misses 4585 4585
Partials 557 557
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
#288 (comment) |
This pull request introduces unit tests for the custom error types
RetryErrorandBadRequestErrordefined inpkg/util/errors/types.go.Purpose:
The tests are added to validate the behavior of our custom error handling, ensuring that:
Error()methods produce the correct string output.Is...andAs...helper functions correctly identify and unwrap custom errors, even when they are wrapped by other errors usingfmt.Errorfwith%w.