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(bug): do not write internal error to the users responseWriter #700

Merged
merged 3 commits into from
Jun 3, 2021

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Jun 3, 2021

Reason for This PR

closes: #691
closes: #659

Description of Changes

  • Handle internal errors and write only status code to the user. The original error would be in the logs.
  • Handle SoftJob errors and send them w/o modifications to the logger.
  • Add new options to the HTTP config: internal_error_code to override default 500 internal HTTP error code (useful for the LB).

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

  error
- Handle SoftJob error

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian added the B-bug Bug: bug, exception label Jun 3, 2021
@rustatian rustatian added this to the 2.3.0 milestone Jun 3, 2021
@rustatian rustatian requested a review from wolfy-j June 3, 2021 11:59
@rustatian rustatian self-assigned this Jun 3, 2021
@codecov
Copy link

codecov bot commented Jun 3, 2021

Codecov Report

Merging #700 (7daadf3) into master (9c01e7a) will increase coverage by 0.22%.
The diff coverage is 83.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
+ Coverage   69.15%   69.37%   +0.22%     
==========================================
  Files          91       91              
  Lines        4422     4451      +29     
==========================================
+ Hits         3058     3088      +30     
  Misses        969      969              
+ Partials      395      394       -1     
Impacted Files Coverage Δ
pkg/worker_watcher/worker_watcher.go 85.71% <ø> (ø)
pkg/worker_handler/request.go 80.95% <33.33%> (+0.30%) ⬆️
pkg/worker/sync_worker.go 77.08% <42.85%> (ø)
pkg/worker_handler/handler.go 69.89% <86.95%> (+5.33%) ⬆️
pkg/pool/static_pool.go 80.95% <100.00%> (+0.13%) ⬆️
pkg/worker/worker.go 90.66% <100.00%> (+0.12%) ⬆️
pkg/worker_handler/response.go 88.88% <100.00%> (+0.31%) ⬆️
plugins/http/config/http.go 57.81% <100.00%> (+1.36%) ⬆️
plugins/http/plugin.go 81.92% <100.00%> (+0.20%) ⬆️
plugins/server/plugin.go 62.01% <100.00%> (+1.35%) ⬆️
... and 1 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 9c01e7a...7daadf3. Read the comment docs.

- Update tests

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian marked this pull request as ready for review June 3, 2021 14:11
@rustatian rustatian merged commit c3e57fd into master Jun 3, 2021
@bors bors bot deleted the feature/ovveride_default_error_page branch June 3, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception
Projects
None yet
1 participant