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

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

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 08 May 2026 05:30PM 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:30PM UTC coverage: 96.874% (-0.06%) from 96.935%
25569818500

push

github

ericproulx
Catch and route exceptions raised inside rescue_from blocks

Resolves #2482. Today, an exception raised inside a `rescue_from`
block bubbles up uncaught and produces the Rack default 500 page,
which means deliberate re-raises (a common pattern for translating
one exception class into another) don't compose with the rest of a
user's `rescue_from` configuration, and accidental crashes inside a
handler are not framed as Grape responses.

The middleware now wraps the user's handler invocation with a
StandardError rescue and, on raise, routes the new exception through
one of three paths:

  1. If the re-raised exception's class has a registered `rescue_from`
     handler, run it (with `redispatched: true` so a second raise stops
     the chain — bounded at one redispatch to prevent loops).
  2. If the re-raised exception is a `Grape::Exceptions::Base` subclass,
     render it via the default Grape error path with its own `status`
     and `message`. Inheritance signals the message is part of the API
     contract.
  3. Otherwise, fall through to `safe_default`: log the original
     exception via the API's logger, expose it on
     `env['grape.exception']` for upstream Rack middleware to observe,
     and render `Grape::Exceptions::InternalServerError` (status 500,
     generic message). The original exception's message is never
     surfaced to the API consumer in this branch.

Also adds:
  - `Grape::Exceptions::InternalServerError` — i18n-backed safe stand-in.
  - `Grape::Env::GRAPE_EXCEPTION` — env key carrying the original.
  - `oneof: 'does not match...'` removed (was on a different branch).

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 updated to document the
new behaviour and the registered-handler escape hatch for users who
want raw exception messages exposed (e.g. development mode).

Co-Authored-By: Claud... (continued)

1090 of 1179 branches covered (92.45%)

Branch coverage included in aggregate %.

25 of 25 new or added lines in 3 files covered. (100.0%)

3435 of 3492 relevant lines covered (98.37%)

32030.25 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rails_7_2.gemfile - 25569818500.1 08 May 2026 05:31PM UTC 158
95.58
GitHub Action Run
2 run-4.0-gemfiles/rails_7_2.gemfile - 25569818500.2 08 May 2026 05:31PM UTC 158
95.58
GitHub Action Run
3 run-3.3-gemfiles/rails_8_0.gemfile - 25569818500.3 08 May 2026 05:31PM UTC 158
95.56
GitHub Action Run
4 run-3.2-gemfiles/rack_2_2.gemfile - 25569818500.4 08 May 2026 05:31PM UTC 157
95.56
GitHub Action Run
5 run-3.2-Gemfile - 25569818500.5 08 May 2026 05:30PM UTC 157
95.6
GitHub Action Run
6 run-3.4-gemfiles/rack_3_1.gemfile - 25569818500.6 08 May 2026 05:30PM UTC 157
95.58
GitHub Action Run
7 run-4.0-gemfiles/grape_entity.gemfile - 25569818500.7 08 May 2026 05:31PM UTC 157
49.51
GitHub Action Run
8 run-3.3-gemfiles/rack_2_2.gemfile - 25569818500.8 08 May 2026 05:30PM UTC 157
95.52
GitHub Action Run
9 run-3.2-gemfiles/rack_3_0.gemfile - 25569818500.9 08 May 2026 05:30PM UTC 157
95.6
GitHub Action Run
10 run-4.0-gemfiles/rack_3_1.gemfile - 25569818500.10 08 May 2026 05:30PM UTC 157
95.58
GitHub Action Run
11 run-3.2-gemfiles/rails_8_1.gemfile - 25569818500.11 08 May 2026 05:30PM UTC 158
95.61
GitHub Action Run
12 run-3.2-gemfiles/rails_8_0.gemfile - 25569818500.12 08 May 2026 05:30PM UTC 158
95.61
GitHub Action Run
13 run-4.0-Gemfile - 25569818500.13 08 May 2026 05:31PM UTC 157
95.58
GitHub Action Run
14 run-3.2-gemfiles/rack_3_1.gemfile - 25569818500.14 08 May 2026 05:30PM UTC 157
95.6
GitHub Action Run
15 run-4.0-gemfiles/multi_xml.gemfile - 25569818500.15 08 May 2026 05:31PM UTC 157
35.62
GitHub Action Run
16 run-3.4-gemfiles/rack_2_2.gemfile - 25569818500.16 08 May 2026 05:30PM UTC 157
95.54
GitHub Action Run
17 run-3.3-gemfiles/rails_7_2.gemfile - 25569818500.17 08 May 2026 05:30PM UTC 158
95.56
GitHub Action Run
18 run-4.0-gemfiles/multi_json.gemfile - 25569818500.18 08 May 2026 05:30PM UTC 157
35.62
GitHub Action Run
19 run-4.0-gemfiles/rack_2_2.gemfile - 25569818500.19 08 May 2026 05:30PM UTC 157
95.54
GitHub Action Run
20 run-3.2-gemfiles/rails_7_2.gemfile - 25569818500.20 08 May 2026 05:31PM UTC 158
95.61
GitHub Action Run
21 run-3.3-gemfiles/rack_3_0.gemfile - 25569818500.21 08 May 2026 05:30PM UTC 157
95.56
GitHub Action Run
22 run-3.4-gemfiles/rails_8_1.gemfile - 25569818500.22 08 May 2026 05:31PM UTC 158
95.58
GitHub Action Run
23 run-4.0-gemfiles/rails_8_1.gemfile - 25569818500.23 08 May 2026 05:31PM UTC 158
95.58
GitHub Action Run
24 run-4.0-gemfiles/rack_3_0.gemfile - 25569818500.24 08 May 2026 05:30PM UTC 157
95.58
GitHub Action Run
25 run-3.3-gemfiles/rack_3_2.gemfile - 25569818500.25 08 May 2026 05:30PM UTC 157
95.56
GitHub Action Run
26 run-3.3-Gemfile - 25569818500.26 08 May 2026 05:30PM UTC 157
95.56
GitHub Action Run
27 run-3.4-gemfiles/rails_8_0.gemfile - 25569818500.27 08 May 2026 05:30PM UTC 158
95.58
GitHub Action Run
28 run-3.4-gemfiles/rack_3_0.gemfile - 25569818500.28 08 May 2026 05:31PM UTC 157
95.58
GitHub Action Run
29 run-3.3-gemfiles/rack_3_1.gemfile - 25569818500.29 08 May 2026 05:31PM UTC 157
95.56
GitHub Action Run
30 run-3.3-gemfiles/rails_8_1.gemfile - 25569818500.30 08 May 2026 05:30PM UTC 158
95.56
GitHub Action Run
31 run-4.0-gemfiles/dry_validation.gemfile - 25569818500.31 08 May 2026 05:31PM UTC 157
57.64
GitHub Action Run
32 run-3.4-gemfiles/rack_3_2.gemfile - 25569818500.32 08 May 2026 05:30PM UTC 157
95.58
GitHub Action Run
33 run-3.4-Gemfile - 25569818500.33 08 May 2026 05:31PM UTC 157
95.58
GitHub Action Run
34 run-4.0-gemfiles/rack_3_2.gemfile - 25569818500.34 08 May 2026 05:31PM UTC 157
95.58
GitHub Action Run
35 run-4.0-gemfiles/rails_8_0.gemfile - 25569818500.35 08 May 2026 05:31PM UTC 158
95.58
GitHub Action Run
36 run-4.0-gemfiles/hashie.gemfile - 25569818500.36 08 May 2026 05:31PM UTC 157
62.21
GitHub Action Run
37 run-3.2-gemfiles/rack_3_2.gemfile - 25569818500.37 08 May 2026 05:31PM UTC 157
95.6
GitHub Action Run
Source Files on build 25569818500
  • Tree
  • List 158
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25569818500
  • 619fe0a5 on github
  • Prev Build on master (#25406647923)
  • Next Build on fix/rescue-from-internal-errors-2482 (#25569862791)
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