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

Turn input validation errors into 400 errors #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

richfitz
Copy link
Member

This was nastier than expected, but the approach here does seem to work.

There's a difference between the way that plumber handles errors when being served properly, and via the $request approach (now using plumber$call() but the issue predates this). I've put some proper integration tests in which verify that the errors propagate as expected, and then made unit tests for this. I think the only special case we really need is the one added here where the serialiser fails.

@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (f144829) compared to base (18511c4).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head f144829 differs from pull request most recent head 55bafb7. Consider uploading reports for the commit 55bafb7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #30   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          975       955   -20     
=========================================
- Hits           975       955   -20     
Impacted Files Coverage Δ
R/query.R 100.00% <ø> (ø)
R/filter.R 100.00% <100.00%> (ø)
R/porcelain.R 100.00% <100.00%> (ø)
R/request.R 100.00% <100.00%> (ø)
R/input.R 100.00% <0.00%> (ø)
R/utils.R 100.00% <0.00%> (ø)
R/logging.R 100.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@richfitz richfitz marked this pull request as ready for review August 24, 2022 12:23
@richfitz richfitz requested a review from r-ash August 24, 2022 12:23
Copy link
Member

@r-ash r-ash left a comment

Choose a reason for hiding this comment

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

Thanks for talking me through just now, all looks good just couple of small things

  • Remove the old comments
  • test-zzz-serve.R tests pass on current master, we should update so they fail on current master

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.

3 participants