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

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

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

push

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>

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

26672.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30694876944.1 01 Aug 2026 10:02AM UTC 167
47.17
GitHub Action Run
2 run-3.4-gemfiles/rails_8_0.gemfile - 30694876944.2 01 Aug 2026 10:01AM UTC 168
95.62
GitHub Action Run
3 run-4.0-gemfiles/grape_swagger.gemfile - 30694876944.3 01 Aug 2026 10:02AM UTC 167
55.3
GitHub Action Run
4 run-3.3-gemfiles/rails_8_0.gemfile - 30694876944.4 01 Aug 2026 10:02AM UTC 168
95.62
GitHub Action Run
5 run-3.4-gemfiles/rack_3_0.gemfile - 30694876944.5 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
6 run-4.0-gemfiles/rack_3_2.gemfile - 30694876944.6 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
7 run-3.3-gemfiles/rails_7_2.gemfile - 30694876944.7 01 Aug 2026 10:01AM UTC 168
95.62
GitHub Action Run
8 run-4.0-gemfiles/dry_validation.gemfile - 30694876944.8 01 Aug 2026 10:02AM UTC 167
57.99
GitHub Action Run
9 run-4.0-gemfiles/rails_8_0.gemfile - 30694876944.9 01 Aug 2026 10:02AM UTC 168
95.62
GitHub Action Run
10 run-3.3-gemfiles/rack_3_2.gemfile - 30694876944.10 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
11 run-3.4-gemfiles/rack_3_1.gemfile - 30694876944.11 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
12 run-4.0-gemfiles/grape_entity.gemfile - 30694876944.12 01 Aug 2026 10:02AM UTC 167
50.42
GitHub Action Run
13 run-4.0-Gemfile - 30694876944.13 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
14 run-4.0-gemfiles/multi_json.gemfile - 30694876944.14 01 Aug 2026 10:01AM UTC 167
47.73
GitHub Action Run
15 run-4.0-gemfiles/multi_json_1_20.gemfile - 30694876944.15 01 Aug 2026 10:01AM UTC 167
47.77
GitHub Action Run
16 run-3.3-gemfiles/rack_3_0.gemfile - 30694876944.16 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
17 run-3.3-gemfiles/rack_3_1.gemfile - 30694876944.17 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
18 run-4.0-gemfiles/rails_8_1.gemfile - 30694876944.18 01 Aug 2026 10:02AM UTC 168
95.62
GitHub Action Run
19 run-4.0-gemfiles/rack_3_0.gemfile - 30694876944.19 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
20 run-3.3-Gemfile - 30694876944.20 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
21 run-3.3-gemfiles/rack_2_2.gemfile - 30694876944.21 01 Aug 2026 10:02AM UTC 167
95.57
GitHub Action Run
22 run-4.0-gemfiles/rack_3_1.gemfile - 30694876944.22 01 Aug 2026 10:02AM UTC 167
95.61
GitHub Action Run
23 run-3.4-gemfiles/rails_7_2.gemfile - 30694876944.23 01 Aug 2026 10:01AM UTC 168
95.62
GitHub Action Run
24 run-4.0-gemfiles/rack_2_2.gemfile - 30694876944.24 01 Aug 2026 10:01AM UTC 167
95.57
GitHub Action Run
25 run-3.4-gemfiles/rack_3_2.gemfile - 30694876944.25 01 Aug 2026 10:01AM UTC 167
95.61
GitHub Action Run
26 run-3.4-gemfiles/rails_8_1.gemfile - 30694876944.26 01 Aug 2026 10:01AM UTC 168
95.62
GitHub Action Run
27 run-4.0-gemfiles/multi_xml.gemfile - 30694876944.27 01 Aug 2026 10:02AM UTC 167
47.13
GitHub Action Run
28 run-3.4-gemfiles/rack_2_2.gemfile - 30694876944.28 01 Aug 2026 10:01AM UTC 167
95.57
GitHub Action Run
29 run-4.0-gemfiles/hashie.gemfile - 30694876944.29 01 Aug 2026 10:01AM UTC 167
61.89
GitHub Action Run
30 run-3.4-Gemfile - 30694876944.30 01 Aug 2026 10:01AM UTC 167
95.59
GitHub Action Run
31 run-4.0-gemfiles/rails_7_2.gemfile - 30694876944.31 01 Aug 2026 10:02AM UTC 168
95.62
GitHub Action Run
32 run-3.3-gemfiles/rails_8_1.gemfile - 30694876944.32 01 Aug 2026 10:01AM UTC 168
95.62
GitHub Action Run
Source Files on build 30694876944
  • Tree
  • List 168
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30694876944
  • a4cead15 on github
  • Prev Build on master (#30542026971)
  • Next Build on fix/warn-shadowed-rescue-from (#30694892147)
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