• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 30697092169 / 5
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 01 Aug 2026 11:10AM UTC
Files 166
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Aug 2026 11:07AM UTC coverage: 61.894% (-0.1%) from 62.042%
30697092169.5

Pull #2843

github

ericproulx
Let rescue_from :grape_exceptions outrank a catch-all class handler

rescue_from :grape_exceptions is an opt-in to keep Grape's own errors
rendering with their own status -- a validation failure answers 400 rather
than whatever the application's catch-all returns.

It only ever worked against rescue_from :all, which lives in
all_rescue_handler and is consulted last. Written as a class instead,
rescue_from StandardError is a registered handler, matched first, and Grape's
exceptions are StandardErrors -- so the opt-in silently did nothing and
validation errors still came back as 500s:

    rescue_from StandardError { error!('server error', 500) }
    rescue_from :grape_exceptions          # inert

Let the opt-in win over a handler that only matched through a non-Grape
ancestor. A handler registered for a Grape exception class is more precise
than the opt-in and still wins, so an explicit
rescue_from Grape::Exceptions::ValidationErrors keeps its handler.

registered_rescue_handler gains an _entry variant returning the matched class
alongside its handler, since deciding this needs to know *which* class matched,
not just that one did. find_handler resolves the entry once and passes it down.

Application errors still reach the catch-all, rescue_from :all is unchanged,
and InvalidVersionHeader is left alone so it keeps reaching Rack and version
cascading still works.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2843: Let rescue_from :grape_exceptions outrank a catch-all class handler

403 of 1295 branches covered (31.12%)

Branch coverage included in aggregate %.

2800 of 3880 relevant lines covered (72.16%)

7.17 hits per line

Source Files on job run-4.0-gemfiles/hashie.gemfile - 30697092169.5
  • Tree
  • List 166
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30697092169
  • f67e86c7 on github
  • Prev Job for on fix/grape-exceptions-precedence (#30542026971.16)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc