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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 05 May 2026 06:46AM UTC
Jobs 37
Files 157
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

05 May 2026 06:46AM UTC coverage: 96.935% (-0.02%) from 96.955%
25361964135

Pull #2693

github

ericproulx
Introduce Grape::Exceptions::ErrorResponse value object

`Middleware::Error#error_response` previously handled three input shapes
polymorphically: a Hash from `throw :error, {...}`, a `Grape::Exceptions::Base`
subclass, and an arbitrary user-handler return. Hash-style access like
`error[:status]` only worked on exceptions because `Grape::Exceptions::Base#[]`
delegated to `__send__` — a "pretend to be a Hash" trick that propped up the
polymorphism in `error_response`.

Introduce `Grape::Exceptions::ErrorResponse`, a small value object with
`status`, `message`, `headers`, `backtrace`, and `original_exception` readers
plus a `coerce(input)` classifier that normalizes Hash, Exception, and
ErrorResponse inputs into a uniform value at the boundary. The middleware now
calls `coerce` once at entry and reads typed attributes — no more polymorphism
puzzle in the body.

Migrated the seven internal `throw :error, hash` sites to throw `ErrorResponse`
instances. User-defined `throw :error, hash` from custom middleware or
`rescue_from` blocks continues to work via `coerce`.

`Grape::Exceptions::Base#[]` is preserved (still delegates to `__send__`) and
covered by new specs. The only contract change is that the `throw :error`
payload is now an `ErrorResponse` value object instead of a `Hash` — see
UPGRADING for migration notes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2693: Introduce Grape::Exceptions::ErrorResponse value object

1080 of 1165 branches covered (92.7%)

Branch coverage included in aggregate %.

48 of 50 new or added lines in 6 files covered. (96.0%)

3411 of 3468 relevant lines covered (98.36%)

32144.89 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.83
-1.57% lib/grape/middleware/error.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.2-gemfiles/rack_3_0.gemfile - 25361964135.1 05 May 2026 06:46AM UTC 156
95.65
GitHub Action Run
2 run-3.2-gemfiles/rails_7_2.gemfile - 25361964135.2 05 May 2026 06:46AM UTC 157
95.66
GitHub Action Run
3 run-3.3-Gemfile - 25361964135.3 05 May 2026 06:47AM UTC 156
95.61
GitHub Action Run
4 run-3.3-gemfiles/rack_3_0.gemfile - 25361964135.4 05 May 2026 06:47AM UTC 156
95.61
GitHub Action Run
5 run-4.0-gemfiles/rails_7_2.gemfile - 25361964135.5 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
6 run-3.3-gemfiles/rails_8_1.gemfile - 25361964135.6 05 May 2026 06:47AM UTC 157
95.61
GitHub Action Run
7 run-3.4-gemfiles/rack_3_2.gemfile - 25361964135.7 05 May 2026 06:46AM UTC 156
95.63
GitHub Action Run
8 run-3.2-gemfiles/rack_3_2.gemfile - 25361964135.8 05 May 2026 06:46AM UTC 156
95.65
GitHub Action Run
9 run-4.0-gemfiles/rack_2_2.gemfile - 25361964135.9 05 May 2026 06:47AM UTC 156
95.59
GitHub Action Run
10 run-4.0-gemfiles/hashie.gemfile - 25361964135.10 05 May 2026 06:47AM UTC 156
62.55
GitHub Action Run
11 run-3.4-gemfiles/rack_3_1.gemfile - 25361964135.11 05 May 2026 06:46AM UTC 156
95.63
GitHub Action Run
12 run-3.4-gemfiles/rails_7_2.gemfile - 25361964135.12 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
13 run-4.0-gemfiles/multi_json.gemfile - 25361964135.13 05 May 2026 06:47AM UTC 156
35.74
GitHub Action Run
14 run-4.0-gemfiles/rails_8_0.gemfile - 25361964135.14 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
15 run-3.4-gemfiles/rails_8_0.gemfile - 25361964135.15 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
16 run-3.2-gemfiles/rails_8_0.gemfile - 25361964135.16 05 May 2026 06:46AM UTC 157
95.66
GitHub Action Run
17 run-3.2-Gemfile - 25361964135.17 05 May 2026 06:46AM UTC 156
95.65
GitHub Action Run
18 run-3.3-gemfiles/rack_2_2.gemfile - 25361964135.18 05 May 2026 06:46AM UTC 156
95.56
GitHub Action Run
19 run-4.0-gemfiles/dry_validation.gemfile - 25361964135.19 05 May 2026 06:47AM UTC 156
57.94
GitHub Action Run
20 run-4.0-gemfiles/rack_3_2.gemfile - 25361964135.20 05 May 2026 06:47AM UTC 156
95.63
GitHub Action Run
21 run-3.2-gemfiles/rack_3_1.gemfile - 25361964135.21 05 May 2026 06:46AM UTC 156
95.65
GitHub Action Run
22 run-3.3-gemfiles/rack_3_1.gemfile - 25361964135.22 05 May 2026 06:46AM UTC 156
95.61
GitHub Action Run
23 run-3.4-gemfiles/rack_3_0.gemfile - 25361964135.23 05 May 2026 06:47AM UTC 156
95.63
GitHub Action Run
24 run-3.3-gemfiles/rails_8_0.gemfile - 25361964135.24 05 May 2026 06:47AM UTC 157
95.61
GitHub Action Run
25 run-4.0-gemfiles/rack_3_0.gemfile - 25361964135.25 05 May 2026 06:46AM UTC 156
95.63
GitHub Action Run
26 run-3.3-gemfiles/rack_3_2.gemfile - 25361964135.26 05 May 2026 06:47AM UTC 156
95.61
GitHub Action Run
27 run-4.0-gemfiles/grape_entity.gemfile - 25361964135.27 05 May 2026 06:47AM UTC 156
49.74
GitHub Action Run
28 run-3.4-gemfiles/rack_2_2.gemfile - 25361964135.28 05 May 2026 06:47AM UTC 156
95.59
GitHub Action Run
29 run-4.0-Gemfile - 25361964135.29 05 May 2026 06:46AM UTC 156
95.63
GitHub Action Run
30 run-3.2-gemfiles/rack_2_2.gemfile - 25361964135.30 05 May 2026 06:46AM UTC 156
95.61
GitHub Action Run
31 run-3.4-gemfiles/rails_8_1.gemfile - 25361964135.31 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
32 run-4.0-gemfiles/rack_3_1.gemfile - 25361964135.32 05 May 2026 06:47AM UTC 156
95.63
GitHub Action Run
33 run-4.0-gemfiles/multi_xml.gemfile - 25361964135.33 05 May 2026 06:47AM UTC 156
35.74
GitHub Action Run
34 run-3.4-Gemfile - 25361964135.34 05 May 2026 06:47AM UTC 156
95.63
GitHub Action Run
35 run-3.3-gemfiles/rails_7_2.gemfile - 25361964135.35 05 May 2026 06:47AM UTC 157
95.61
GitHub Action Run
36 run-3.2-gemfiles/rails_8_1.gemfile - 25361964135.36 05 May 2026 06:47AM UTC 157
95.66
GitHub Action Run
37 run-4.0-gemfiles/rails_8_1.gemfile - 25361964135.37 05 May 2026 06:47AM UTC 157
95.63
GitHub Action Run
Source Files on build 25361964135
  • Tree
  • List 157
  • Changed 6
  • Source Changed 5
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25361964135
  • Pull Request #2693
  • PR Base - master (#25361575770)
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