Replies: 2 comments
-
|
With the error_handler plugin: plugin :error_handler do |e|
case e
when Rack::Multipart::EmptyContentError
response.status = 400
"Invalid request body"
else
# whatever you want
end
endHowever, you may be better off using the invalid_request_body plugin: https://roda.jeremyevans.net/rdoc/classes/Roda/RodaPlugins/InvalidRequestBody.html |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
As always, thank you very much for the prompt and excellent help! 😃 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Since Rack 3, sending a malformed request results in a
Rack::Multipart::EmptyContentErrorbeing thrown. I found some discussion in a rack issue: rack/rack#2093.Is there a way to rescue from this and throw a 4xx error code rather than have the error bubble up the stack and result in a 500 server side error? I could not find specifics in the
error_handlerplugin.Beta Was this translation helpful? Give feedback.
All reactions