ruby-grape / ruby-grape/grape

NoMethodError(undefined method `bad_request?')

Open
#1,669 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug?
Dominant language
Ruby
Stars
10k
Forks
1.2k
Avg merge
14h 38m
Merged PRs (30d)
92

Description

As an example: config.ru

Once an error is raised in API (in the code above, it's an " undefined method `session' " error), I can only get the following exception in the response:

NoMethodError: undefined method `bad_request?' for #Rack::ShowExceptions:0x007f7458d7b1e8

without any information related to the original error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the config.ru example and reproduce the API error that triggers Rack::ShowExceptions. Trace why the original session NoMethodError is replaced by the bad_request? exception, then verify that the response preserves useful information about the original error.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.