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: use of conventient errors for sec errors as well. Also fixed recordErr. #1033

Merged
merged 2 commits into from
Sep 10, 2023

Conversation

alesbrelih
Copy link
Contributor

Use convenient errors inside security handlers as well.
This way we can format security responses without modifying error handler which seems a bit better I think. But this can be a breaking change, because if someone is using convenient errors now, they will get 500 error or what they mapped their default response.
If you think I should put this under a new flag, please let me know (or any other suggestion)

Also:
Using convenient errors recordErr was called everytime. It shouldn't be called for non 500 status codes. I've updated this in the second commit.

Use convenient errors inside security handlers as well.
This way we can format security responses without modifying error
handler.
@alesbrelih alesbrelih force-pushed the feat/sec-conventient-err branch 2 times, most recently from 6bfb125 to 6b5b9c5 Compare September 9, 2023 17:38
@codecov
Copy link

codecov bot commented Sep 9, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02% ⚠️

Comparison is base (ca166cb) 72.23% compared to head (9088f91) 72.21%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1033      +/-   ##
==========================================
- Coverage   72.23%   72.21%   -0.02%     
==========================================
  Files         192      192              
  Lines       15003    15003              
==========================================
- Hits        10837    10835       -2     
- Misses       3631     3632       +1     
- Partials      535      536       +1     

see 1 file with indirect coverage changes

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

@alesbrelih
Copy link
Contributor Author

Wops, forgot to regenerate code after the second commit.

gen/_template/handlers.tmpl Outdated Show resolved Hide resolved
gen/_template/handlers.tmpl Outdated Show resolved Hide resolved
Using convenient errors recordErr was called everytime. It shouldn't be
run for non 500 status codes.
@tdakkota tdakkota merged commit 21fa7c7 into ogen-go:main Sep 10, 2023
15 checks passed
@alesbrelih alesbrelih deleted the feat/sec-conventient-err branch September 11, 2023 06:53
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.

2 participants