InvalidMessageBody is no longer rescuable
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
I'm in the process of upgrading to the current version from an ancient one.
We previously used rescue_from Grape::Exceptions::InvalidMessageBody to catch unknown upload formats and document what the valid upload types are.
However, in https://github.com/ruby-grape/grape/blob/master/lib/grape/exceptions/invalid_message_body.rb a generic error is being raised instead of an InvalidMessageBody.
I don't see a straightforward hook for this; would it make sense to use InvalidMessageBody there?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/grape/exceptions/invalid_message_body.rb and trace the upload-format error path that currently raises a generic error. Confirm how rescue_from Grape::Exceptions::InvalidMessageBody is expected to handle unknown upload formats; done means those errors are rescuable through that hook, with coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100