google / go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.
https://gocloud.dev/
Apache License 2.0
9.45k stars 799 forks source link

pubsub/rabbitpubsub: wrap pubsub rabbitmq errors #3437

Closed peczenyj closed 1 month ago

peczenyj commented 1 month ago

I note that we mere add a %v reference to the original rabbitmq errors, and since we may need to unwrap such errors, it is better use %w

I also create few global errors to return instead allocate a new error in some trivial cases

Enjoy

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.31%. Comparing base (9cc772b) to head (c1a38e2). Report is 3 commits behind head on master.

Files Patch % Lines
pubsub/rabbitpubsub/rabbit.go 82.35% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3437 +/- ## ========================================== - Coverage 73.32% 73.31% -0.01% ========================================== Files 113 113 Lines 14937 14940 +3 ========================================== + Hits 10953 10954 +1 - Misses 3206 3208 +2 Partials 778 778 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

peczenyj commented 1 month ago

I like the %v -> %w change, but not really the constant errors; they just seem like they add a level of indirection that makes the code less readable. Can you revert that change?

Done