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

[coordinator] Make <500 endpoint errors as invalid params error #3783

Merged
merged 6 commits into from
Oct 4, 2021

Conversation

Antanukas
Copy link
Collaborator

@Antanukas Antanukas commented Sep 27, 2021

What this PR does / why we need it:

map <500 response codes to 400.

Special notes for your reviewer:

Makes sure 4xx errors are wrapped in InvalidParamsError that eventually gets mapped to 400 HTTP status code.
This is important because prometheus scraper retries 5xx errors. Before this change any errors returned from endpoint would have been mapped to 500.

Storage layer abstracts away HTTP so it's not possible to just respond with same status codes as in response from the endpoint. However it seems enough to map to 400 or 500 based on Prometheus scraper implementation.

Does this PR introduce a user-facing and/or backwards incompatible change?:

None

Does this PR require updating code package or user-facing documentation?:

None

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #3783 (1583d16) into master (8028eef) will decrease coverage by 0.2%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #3783     +/-   ##
========================================
- Coverage    57.0%   56.8%   -0.3%     
========================================
  Files         552     552             
  Lines       63077   63077             
========================================
- Hits        35999   35867    -132     
- Misses      23892   24003    +111     
- Partials     3186    3207     +21     
Flag Coverage Δ
aggregator 63.3% <ø> (-0.2%) ⬇️
cluster ∅ <ø> (∅)
collector 58.4% <ø> (ø)
dbnode 60.5% <ø> (-0.3%) ⬇️
m3em 46.4% <ø> (ø)
metrics 19.7% <ø> (ø)
msg 74.0% <ø> (-0.5%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8028eef...1583d16. Read the comment docs.

@Antanukas Antanukas marked this pull request as ready for review September 27, 2021 14:37
@Antanukas Antanukas merged commit a3270bf into master Oct 4, 2021
@Antanukas Antanukas deleted the antanas/better-error-handling branch October 4, 2021 10:41
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