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

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

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 08 May 2026 05:39PM UTC
Jobs 37
Files 158
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

08 May 2026 05:38PM UTC coverage: 96.884% (-0.05%) from 96.935%
25570206807

Pull #2703

github

ericproulx
Catch and route exceptions raised inside rescue_from blocks

Resolves #2482. An exception raised inside a `rescue_from` block
used to bubble uncaught and produce the Rack default 500 page. The
middleware now catches it and routes it through one of three paths:

  1. The exception's class has a registered `rescue_from` handler →
     run that handler (with `redispatched: true` so a second raise
     stops the chain — bounded at one redispatch).
  2. The exception is a `Grape::Exceptions::Base` subclass → render
     it via the default Grape error path with its own status and
     message.
  3. Otherwise → fall through to safe_default. The original is
     exposed on `env['grape.exception']` for upstream Rack middleware
     to observe. If the user opted into
     `rescue_from :internal_grape_exceptions do |e| ... end`, that
     handler runs and owns the response shape and any logging.
     Otherwise the framework logs the exception via the API's logger
     and renders `Grape::Exceptions::InternalServerError` (status
     500, generic message) — never the original exception's message.

Adds:
  * `Grape::Exceptions::InternalServerError` — i18n-backed safe
    stand-in.
  * `Grape::Env::GRAPE_EXCEPTION` — env key carrying the original.
  * `rescue_from :internal_grape_exceptions` — DSL opt-in mirroring
    `:grape_exceptions`. Lets the application capture the exception,
    forward it to error trackers, and shape the response.

Existing behaviour preserved when the handler returns a non-Response
non-error value (still produces `InvalidResponse` via the default
handler).

UPGRADING note + README rescue_from section document the new
behaviour and the `:internal_grape_exceptions` opt-in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2703: Catch exceptions raised inside rescue_from blocks (#2482)

1094 of 1183 branches covered (92.48%)

Branch coverage included in aggregate %.

29 of 29 new or added lines in 5 files covered. (100.0%)

3 existing lines in 1 file now uncovered.

3445 of 3502 relevant lines covered (98.37%)

32024.11 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
93.51
-1.32% lib/grape/middleware/error.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rails_8_0.gemfile - 25570206807.1 08 May 2026 05:39PM UTC 158
95.6
GitHub Action Run
2 run-3.2-gemfiles/rails_7_2.gemfile - 25570206807.2 08 May 2026 05:39PM UTC 158
95.62
GitHub Action Run
3 run-3.2-gemfiles/rack_3_1.gemfile - 25570206807.3 08 May 2026 05:39PM UTC 157
95.62
GitHub Action Run
4 run-4.0-Gemfile - 25570206807.4 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
5 run-3.3-gemfiles/rack_3_0.gemfile - 25570206807.5 08 May 2026 05:39PM UTC 157
95.57
GitHub Action Run
6 run-3.2-gemfiles/rack_2_2.gemfile - 25570206807.6 08 May 2026 05:39PM UTC 157
95.57
GitHub Action Run
7 run-3.4-gemfiles/rack_3_0.gemfile - 25570206807.7 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
8 run-3.3-gemfiles/rails_7_2.gemfile - 25570206807.8 08 May 2026 05:39PM UTC 158
95.58
GitHub Action Run
9 run-3.4-gemfiles/rails_8_1.gemfile - 25570206807.9 08 May 2026 05:39PM UTC 158
95.6
GitHub Action Run
10 run-3.3-gemfiles/rack_3_2.gemfile - 25570206807.10 08 May 2026 05:39PM UTC 157
95.57
GitHub Action Run
11 run-4.0-gemfiles/multi_xml.gemfile - 25570206807.11 08 May 2026 05:39PM UTC 157
35.56
GitHub Action Run
12 run-3.2-Gemfile - 25570206807.12 08 May 2026 05:39PM UTC 157
95.62
GitHub Action Run
13 run-3.4-gemfiles/rails_7_2.gemfile - 25570206807.13 08 May 2026 05:39PM UTC 158
95.6
GitHub Action Run
14 run-3.3-gemfiles/rack_2_2.gemfile - 25570206807.14 08 May 2026 05:39PM UTC 157
95.53
GitHub Action Run
15 run-3.4-gemfiles/rack_2_2.gemfile - 25570206807.15 08 May 2026 05:39PM UTC 157
95.55
GitHub Action Run
16 run-4.0-gemfiles/rails_7_2.gemfile - 25570206807.16 08 May 2026 05:39PM UTC 158
95.6
GitHub Action Run
17 run-3.2-gemfiles/rack_3_2.gemfile - 25570206807.17 08 May 2026 05:39PM UTC 157
95.62
GitHub Action Run
18 run-4.0-gemfiles/grape_entity.gemfile - 25570206807.18 08 May 2026 05:39PM UTC 157
49.49
GitHub Action Run
19 run-4.0-gemfiles/rack_2_2.gemfile - 25570206807.19 08 May 2026 05:39PM UTC 157
95.55
GitHub Action Run
20 run-4.0-gemfiles/hashie.gemfile - 25570206807.20 08 May 2026 05:39PM UTC 157
62.15
GitHub Action Run
21 run-3.4-Gemfile - 25570206807.21 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
22 run-3.4-gemfiles/rack_3_2.gemfile - 25570206807.22 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
23 run-3.3-gemfiles/rack_3_1.gemfile - 25570206807.23 08 May 2026 05:39PM UTC 157
95.57
GitHub Action Run
24 run-4.0-gemfiles/rack_3_0.gemfile - 25570206807.24 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
25 run-3.3-gemfiles/rails_8_0.gemfile - 25570206807.25 08 May 2026 05:39PM UTC 158
95.58
GitHub Action Run
26 run-4.0-gemfiles/rack_3_2.gemfile - 25570206807.26 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
27 run-3.4-gemfiles/rack_3_1.gemfile - 25570206807.27 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
28 run-3.2-gemfiles/rails_8_1.gemfile - 25570206807.28 08 May 2026 05:39PM UTC 158
95.62
GitHub Action Run
29 run-4.0-gemfiles/multi_json.gemfile - 25570206807.29 08 May 2026 05:39PM UTC 157
35.56
GitHub Action Run
30 run-4.0-gemfiles/rails_8_1.gemfile - 25570206807.30 08 May 2026 05:39PM UTC 158
95.6
GitHub Action Run
31 run-4.0-gemfiles/rails_8_0.gemfile - 25570206807.31 08 May 2026 05:40PM UTC 158
95.6
GitHub Action Run
32 run-3.3-Gemfile - 25570206807.32 08 May 2026 05:39PM UTC 157
95.57
GitHub Action Run
33 run-3.3-gemfiles/rails_8_1.gemfile - 25570206807.33 08 May 2026 05:39PM UTC 158
95.58
GitHub Action Run
34 run-3.2-gemfiles/rails_8_0.gemfile - 25570206807.34 08 May 2026 05:39PM UTC 158
95.62
GitHub Action Run
35 run-3.2-gemfiles/rack_3_0.gemfile - 25570206807.35 08 May 2026 05:39PM UTC 157
95.62
GitHub Action Run
36 run-4.0-gemfiles/rack_3_1.gemfile - 25570206807.36 08 May 2026 05:39PM UTC 157
95.59
GitHub Action Run
37 run-4.0-gemfiles/dry_validation.gemfile - 25570206807.37 08 May 2026 05:39PM UTC 157
57.6
GitHub Action Run
Source Files on build 25570206807
  • Tree
  • List 158
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25570206807
  • Pull Request #2703
  • PR Base - master (#25564552185)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc