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

Update HTTPAPI handlers to return non-200 status codes when errors occur (SYN-8734) #4169

Merged
merged 28 commits into from
Apr 1, 2025

Conversation

vEpiphyte
Copy link
Contributor

@vEpiphyte vEpiphyte commented Mar 5, 2025

  • Errors sent by HTTP APIs ( via sendRestErr / sentRestExc ) now have non-200 HTTP status codes sent. These errors still contain valid JSON in their responses.
  • Storm APIs will now catch errors and return a non-200 status code when a query execution precondition fails; so users can now better distinguish failures from a successful query.
  • Added status_code keyword only arguments to sendRestRetn / sendRestErr / sendRestExc
  • sendRestExc now pulls a mesg from SynErr errors before relying on str(e).
  • Changed HTTP codes in handlers and tests to use the stdlib http.HTTPStatus enum

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.29%. Comparing base (380275b) to head (780f4f5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4169      +/-   ##
==========================================
- Coverage   97.35%   97.29%   -0.07%     
==========================================
  Files         261      261              
  Lines       59877    59894      +17     
==========================================
- Hits        58294    58273      -21     
- Misses       1583     1621      +38     
Flag Coverage Δ
linux 97.29% <100.00%> (+<0.01%) ⬆️
linux_replay ?

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vEpiphyte vEpiphyte marked this pull request as ready for review March 28, 2025 16:15
@vEpiphyte vEpiphyte changed the title Update Storm HTTPAPI handlers to return non-200 status codes when errors occur (SYN-8734) Update HTTPAPI handlers to return non-200 status codes when errors occur (SYN-8734) Mar 28, 2025
@vEpiphyte vEpiphyte added the bug label Mar 28, 2025
Copy link
Contributor

@MichaelSquires MichaelSquires left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the requested changes are integers to http.HTTPStatus.XXX codes.

Cisphyx
Cisphyx previously approved these changes Mar 31, 2025
Cisphyx
Cisphyx previously approved these changes Mar 31, 2025
invisig0th
invisig0th previously approved these changes Mar 31, 2025
…SuchView with their own codes

Update the loginV1 handler to sent 403/404 codes on errors.
@vEpiphyte vEpiphyte added this to the v2.206.0 milestone Mar 31, 2025
@vEpiphyte vEpiphyte merged commit ac326f1 into master Apr 1, 2025
5 checks passed
@vEpiphyte vEpiphyte deleted the epiphyte-storm-http-errs branch April 1, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants