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

feat: improve error handling #85

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

abemedia
Copy link
Owner

@abemedia abemedia commented May 5, 2023

  • Ignore error's status code if explicitly wrapped with a status code.
  • Return 404 on failure to decode path params.
  • Text encoder uses TextMarshaler over error
  • Remove redundant StatusError code.
  • Return correct status code & message for server errors.

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage: 69.56% and project coverage change: +1.66 🎉

Comparison is base (5bd82f6) 66.41% compared to head (0c6fee1) 68.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
+ Coverage   66.41%   68.07%   +1.66%     
==========================================
  Files          23       23              
  Lines         914      899      -15     
==========================================
+ Hits          607      612       +5     
+ Misses        265      244      -21     
- Partials       42       43       +1     
Impacted Files Coverage Δ
handler.go 80.20% <64.70%> (-1.05%) ⬇️
errors.go 40.00% <75.00%> (+18.46%) ⬆️
encoding/text/encode.go 96.15% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abemedia abemedia force-pushed the feat/improve-error-handling branch 3 times, most recently from 6ae2860 to 4d1ae30 Compare May 5, 2023 00:59
@abemedia abemedia force-pushed the feat/improve-error-handling branch from 4d1ae30 to 0c6fee1 Compare May 5, 2023 01:08
@abemedia abemedia merged commit 3f976fc into master May 5, 2023
@abemedia abemedia deleted the feat/improve-error-handling branch May 5, 2023 01:11
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.

1 participant