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

ruby-grape / grape / 30697091164
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 01 Aug 2026 11:08AM UTC
Jobs 32
Files 168
Run time 1min
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: 96.989% (+0.01%) from 96.976%
30697091164

Pull #2842

github

ericproulx
Warn when a rescue_from handler can never run

Grape::Middleware::Error resolves a registered handler with #find, so within a
scope the first matching class wins. A handler registered for a class an
earlier one already covers is therefore dead code, and silently so:

    rescue_from StandardError do ... end   # wins
    rescue_from ArgumentError do ... end   # never runs

Swapping the two lines is all it takes, but nothing said so -- and the
neighbouring `rescue_from :all` behaves the other way round, since it is
consulted only after the registered handlers, so a specific class registered
after it still wins. Two documented ways of saying "catch everything",
ordering differently against a later specific handler.

Warn at definition time rather than reorder: which handler should win is the
author's call, and :all already covers "broad first, specific still wins".
The check lives in Grape::Util::ShadowedRescueHandlers, called from
#add_rescue_handlers where the scope's own registrations are known.

Compared within a scope only -- across scopes the nearest registration
deliberately wins, so an inner rescue_from StandardError shadowing an outer
rescue_from ArgumentError is the documented behaviour, not a mistake. Classes
sharing a handler object are skipped too, since `rescue_from A, B` registers
one handler for both and the entry that loses changes nothing. Exact-match
handlers (rescue_subclasses: false) are consulted before the subclass-matching
ones and never match a descendant, so they cannot shadow each other either.

README gains the ordering rule, which was only implied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2842: Warn when a rescue_from handler can never run

1204 of 1293 branches covered (93.12%)

Branch coverage included in aggregate %.

3821 of 3888 relevant lines covered (98.28%)

26677.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_3_1.gemfile - 30697091164.1 01 Aug 2026 11:09AM UTC 167
95.61
GitHub Action Run
2 run-3.4-gemfiles/rails_8_1.gemfile - 30697091164.2 01 Aug 2026 11:09AM UTC 168
95.62
GitHub Action Run
3 run-4.0-gemfiles/rails_7_2.gemfile - 30697091164.3 01 Aug 2026 11:09AM UTC 168
95.62
GitHub Action Run
4 run-4.0-gemfiles/hashie.gemfile - 30697091164.4 01 Aug 2026 11:08AM UTC 167
61.89
GitHub Action Run
5 run-4.0-gemfiles/rack_3_2.gemfile - 30697091164.5 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
6 run-4.0-gemfiles/rails_8_1.gemfile - 30697091164.6 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
7 run-4.0-gemfiles/rack_2_2.gemfile - 30697091164.7 01 Aug 2026 11:08AM UTC 167
95.57
GitHub Action Run
8 run-4.0-gemfiles/rails_8_0.gemfile - 30697091164.8 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
9 run-4.0-gemfiles/grape_entity.gemfile - 30697091164.9 01 Aug 2026 11:08AM UTC 167
50.42
GitHub Action Run
10 run-3.4-gemfiles/rails_7_2.gemfile - 30697091164.10 01 Aug 2026 11:09AM UTC 168
95.62
GitHub Action Run
11 run-3.4-gemfiles/rails_8_0.gemfile - 30697091164.11 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
12 run-4.0-gemfiles/multi_xml.gemfile - 30697091164.12 01 Aug 2026 11:08AM UTC 167
47.13
GitHub Action Run
13 run-4.0-gemfiles/grape_swagger.gemfile - 30697091164.13 01 Aug 2026 11:08AM UTC 167
55.3
GitHub Action Run
14 run-3.4-gemfiles/rack_2_2.gemfile - 30697091164.14 01 Aug 2026 11:08AM UTC 167
95.57
GitHub Action Run
15 run-3.3-Gemfile - 30697091164.15 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
16 run-4.0-gemfiles/multi_json.gemfile - 30697091164.16 01 Aug 2026 11:08AM UTC 167
47.73
GitHub Action Run
17 run-4.0-gemfiles/multi_json_1_20.gemfile - 30697091164.17 01 Aug 2026 11:09AM UTC 167
47.77
GitHub Action Run
18 run-4.0-gemfiles/dry_validation.gemfile - 30697091164.18 01 Aug 2026 11:09AM UTC 167
57.99
GitHub Action Run
19 run-3.3-gemfiles/rack_2_2.gemfile - 30697091164.19 01 Aug 2026 11:08AM UTC 167
95.57
GitHub Action Run
20 run-3.4-Gemfile - 30697091164.20 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
21 run-3.3-gemfiles/rack_3_0.gemfile - 30697091164.21 01 Aug 2026 11:09AM UTC 167
95.61
GitHub Action Run
22 run-3.3-gemfiles/rails_8_1.gemfile - 30697091164.22 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
23 run-3.3-gemfiles/rack_3_2.gemfile - 30697091164.23 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
24 run-3.3-gemfiles/rails_7_2.gemfile - 30697091164.24 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
25 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30697091164.25 01 Aug 2026 11:08AM UTC 167
47.17
GitHub Action Run
26 run-3.3-gemfiles/rails_8_0.gemfile - 30697091164.26 01 Aug 2026 11:08AM UTC 168
95.62
GitHub Action Run
27 run-4.0-Gemfile - 30697091164.27 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
28 run-3.4-gemfiles/rack_3_2.gemfile - 30697091164.28 01 Aug 2026 11:09AM UTC 167
95.61
GitHub Action Run
29 run-3.4-gemfiles/rack_3_1.gemfile - 30697091164.29 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
30 run-3.3-gemfiles/rack_3_1.gemfile - 30697091164.30 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
31 run-3.4-gemfiles/rack_3_0.gemfile - 30697091164.31 01 Aug 2026 11:08AM UTC 167
95.61
GitHub Action Run
32 run-4.0-gemfiles/rack_3_0.gemfile - 30697091164.32 01 Aug 2026 11:09AM UTC 167
95.61
GitHub Action Run
Source Files on build 30697091164
  • Tree
  • List 168
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30697091164
  • Pull Request #2842
  • PR Base - master (#30542026971)
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