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

fix: don't force server errors in legacy server #517

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

muhlemmer
Copy link
Collaborator

@muhlemmer muhlemmer commented Jan 16, 2024

This PR changes the way we re-throw errors. In the old solution, the Legacy Server used NewStatusError which forces a particular HTTP status code, even if one was already set from downstream. Instead now we us AsStatusError. This only sets a status code if one wasn't set already.

The WriteError function is also rewritten to make better distinction between error types and status codes.

Related: #291

Definition of Ready

  • I am happy with the code
  • Short description of the feature/issue is added in the pr description
  • PR is linked to the corresponding user story
  • Acceptance criteria are met
  • All open todos and follow ups are defined in a new ticket and justified
  • Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • No debug or dead code
  • My code has no repetitions
  • Critical parts are tested automatically
  • Where possible E2E tests are implemented
  • Documentation/examples are up-to-date
  • All non-functional requirements are met
  • Functionality of the acceptance criteria is checked manually on the dev system.

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (844e233) 59.96% compared to head (cf5a6e9) 60.03%.

Files Patch % Lines
pkg/op/auth_request.go 0.00% 5 Missing ⚠️
pkg/op/server_legacy.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
+ Coverage   59.96%   60.03%   +0.06%     
==========================================
  Files          80       80              
  Lines        6981     6993      +12     
==========================================
+ Hits         4186     4198      +12     
  Misses       2498     2498              
  Partials      297      297              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@muhlemmer muhlemmer marked this pull request as ready for review January 17, 2024 09:20
@muhlemmer muhlemmer enabled auto-merge (squash) January 17, 2024 09:20
@muhlemmer muhlemmer requested a review from livio-a January 17, 2024 09:21
@muhlemmer muhlemmer merged commit 57d04e7 into main Jan 17, 2024
8 checks passed
@muhlemmer muhlemmer deleted the fix-server-error branch January 17, 2024 15:06
Copy link

🎉 This PR is included in version 3.10.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants