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

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

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 01 Aug 2026 10:02AM 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 10:01AM UTC coverage: 96.989% (+0.01%) from 96.976%
30694892147

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 %.

14 of 0 new or added lines in 0 files covered. (NaN%)

3821 of 3888 relevant lines covered (98.28%)

26681.61 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_3_1.gemfile - 30694892147.1 01 Aug 2026 10:04AM UTC 167
95.61
GitHub Action Run
2 run-4.0-gemfiles/multi_xml.gemfile - 30694892147.2 01 Aug 2026 10:03AM UTC 167
47.13
GitHub Action Run
3 run-3.3-gemfiles/rack_3_2.gemfile - 30694892147.3 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
4 run-3.3-gemfiles/rack_3_1.gemfile - 30694892147.4 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
5 run-3.4-gemfiles/rails_8_1.gemfile - 30694892147.5 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
6 run-4.0-gemfiles/grape_entity.gemfile - 30694892147.6 01 Aug 2026 10:03AM UTC 167
50.42
GitHub Action Run
7 run-3.4-gemfiles/rack_2_2.gemfile - 30694892147.7 01 Aug 2026 10:03AM UTC 167
95.57
GitHub Action Run
8 run-4.0-gemfiles/multi_json_1_20.gemfile - 30694892147.8 01 Aug 2026 10:03AM UTC 167
47.77
GitHub Action Run
9 run-4.0-gemfiles/rails_8_1.gemfile - 30694892147.9 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
10 run-4.0-gemfiles/rails_8_0.gemfile - 30694892147.10 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
11 run-4.0-gemfiles/dry_validation.gemfile - 30694892147.11 01 Aug 2026 10:03AM UTC 167
57.99
GitHub Action Run
12 run-3.3-gemfiles/rails_7_2.gemfile - 30694892147.12 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
13 run-4.0-gemfiles/multi_json.gemfile - 30694892147.13 01 Aug 2026 10:03AM UTC 167
47.73
GitHub Action Run
14 run-3.4-gemfiles/rack_3_1.gemfile - 30694892147.14 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
15 run-4.0-gemfiles/hashie.gemfile - 30694892147.15 01 Aug 2026 10:03AM UTC 167
61.89
GitHub Action Run
16 run-3.4-gemfiles/rails_7_2.gemfile - 30694892147.16 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
17 run-4.0-Gemfile - 30694892147.17 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
18 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30694892147.18 01 Aug 2026 10:03AM UTC 167
47.17
GitHub Action Run
19 run-3.3-gemfiles/rack_3_0.gemfile - 30694892147.19 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
20 run-4.0-gemfiles/rack_3_0.gemfile - 30694892147.20 01 Aug 2026 10:04AM UTC 167
95.61
GitHub Action Run
21 run-4.0-gemfiles/grape_swagger.gemfile - 30694892147.21 01 Aug 2026 10:02AM UTC 167
55.3
GitHub Action Run
22 run-3.3-gemfiles/rails_8_0.gemfile - 30694892147.22 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
23 run-4.0-gemfiles/rails_7_2.gemfile - 30694892147.23 01 Aug 2026 10:03AM UTC 168
95.62
GitHub Action Run
24 run-3.3-gemfiles/rack_2_2.gemfile - 30694892147.24 01 Aug 2026 10:02AM UTC 167
95.57
GitHub Action Run
25 run-3.4-gemfiles/rack_3_2.gemfile - 30694892147.25 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
26 run-3.4-gemfiles/rails_8_0.gemfile - 30694892147.26 01 Aug 2026 10:02AM UTC 168
95.62
GitHub Action Run
27 run-4.0-gemfiles/rack_2_2.gemfile - 30694892147.27 01 Aug 2026 10:02AM UTC 167
95.57
GitHub Action Run
28 run-3.4-gemfiles/rack_3_0.gemfile - 30694892147.28 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
29 run-3.3-Gemfile - 30694892147.29 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
30 run-3.3-gemfiles/rails_8_1.gemfile - 30694892147.30 01 Aug 2026 10:04AM UTC 168
95.62
GitHub Action Run
31 run-4.0-gemfiles/rack_3_2.gemfile - 30694892147.31 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
32 run-3.4-Gemfile - 30694892147.32 01 Aug 2026 10:03AM UTC 167
95.61
GitHub Action Run
Source Files on build 30694892147
  • 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 #30694892147
  • 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