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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 05 May 2026 06:34AM 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:33AM UTC coverage: 96.951% (-0.03%) from 96.976%
25361551546

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

1081 of 1166 branches covered (92.71%)

Branch coverage included in aggregate %.

40 of 42 new or added lines in 6 files covered. (95.24%)

3402 of 3458 relevant lines covered (98.38%)

32238.5 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.3-Gemfile - 25361551546.1 05 May 2026 06:34AM UTC 156
95.62
GitHub Action Run
2 run-3.4-Gemfile - 25361551546.2 05 May 2026 06:34AM UTC 156
95.64
GitHub Action Run
3 run-3.3-gemfiles/rack_3_1.gemfile - 25361551546.3 05 May 2026 06:34AM UTC 156
95.62
GitHub Action Run
4 run-3.3-gemfiles/rack_2_2.gemfile - 25361551546.4 05 May 2026 06:34AM UTC 156
95.58
GitHub Action Run
5 run-3.4-gemfiles/rack_2_2.gemfile - 25361551546.5 05 May 2026 06:34AM UTC 156
95.6
GitHub Action Run
6 run-3.4-gemfiles/rack_3_0.gemfile - 25361551546.6 05 May 2026 06:35AM UTC 156
95.64
GitHub Action Run
7 run-4.0-gemfiles/rack_3_0.gemfile - 25361551546.7 05 May 2026 06:34AM UTC 156
95.64
GitHub Action Run
8 run-3.2-gemfiles/rack_3_1.gemfile - 25361551546.8 05 May 2026 06:34AM UTC 156
95.67
GitHub Action Run
9 run-3.3-gemfiles/rails_8_0.gemfile - 25361551546.9 05 May 2026 06:34AM UTC 157
95.62
GitHub Action Run
10 run-3.3-gemfiles/rails_7_2.gemfile - 25361551546.10 05 May 2026 06:35AM UTC 157
95.62
GitHub Action Run
11 run-3.4-gemfiles/rack_3_1.gemfile - 25361551546.11 05 May 2026 06:35AM UTC 156
95.64
GitHub Action Run
12 run-3.3-gemfiles/rack_3_2.gemfile - 25361551546.12 05 May 2026 06:34AM UTC 156
95.62
GitHub Action Run
13 run-3.2-Gemfile - 25361551546.13 05 May 2026 06:34AM UTC 156
95.67
GitHub Action Run
14 run-3.2-gemfiles/rails_7_2.gemfile - 25361551546.14 05 May 2026 06:35AM UTC 157
95.67
GitHub Action Run
15 run-3.4-gemfiles/rack_3_2.gemfile - 25361551546.15 05 May 2026 06:35AM UTC 156
95.64
GitHub Action Run
16 run-4.0-Gemfile - 25361551546.16 05 May 2026 06:34AM UTC 156
95.64
GitHub Action Run
17 run-4.0-gemfiles/rack_2_2.gemfile - 25361551546.17 05 May 2026 06:34AM UTC 156
95.6
GitHub Action Run
18 run-4.0-gemfiles/multi_json.gemfile - 25361551546.18 05 May 2026 06:35AM UTC 156
35.73
GitHub Action Run
19 run-3.4-gemfiles/rails_8_1.gemfile - 25361551546.19 05 May 2026 06:35AM UTC 157
95.65
GitHub Action Run
20 run-3.2-gemfiles/rack_3_2.gemfile - 25361551546.20 05 May 2026 06:34AM UTC 156
95.67
GitHub Action Run
21 run-4.0-gemfiles/rails_8_1.gemfile - 25361551546.21 05 May 2026 06:35AM UTC 157
95.65
GitHub Action Run
22 run-4.0-gemfiles/rails_8_0.gemfile - 25361551546.22 05 May 2026 06:35AM UTC 157
95.65
GitHub Action Run
23 run-3.4-gemfiles/rails_7_2.gemfile - 25361551546.23 05 May 2026 06:35AM UTC 157
95.65
GitHub Action Run
24 run-3.4-gemfiles/rails_8_0.gemfile - 25361551546.24 05 May 2026 06:34AM UTC 157
95.65
GitHub Action Run
25 run-4.0-gemfiles/rack_3_1.gemfile - 25361551546.25 05 May 2026 06:34AM UTC 156
95.64
GitHub Action Run
26 run-3.2-gemfiles/rails_8_1.gemfile - 25361551546.26 05 May 2026 06:35AM UTC 157
95.67
GitHub Action Run
27 run-3.3-gemfiles/rack_3_0.gemfile - 25361551546.27 05 May 2026 06:34AM UTC 156
95.62
GitHub Action Run
28 run-3.2-gemfiles/rails_8_0.gemfile - 25361551546.28 05 May 2026 06:34AM UTC 157
95.67
GitHub Action Run
29 run-4.0-gemfiles/multi_xml.gemfile - 25361551546.29 05 May 2026 06:35AM UTC 156
35.73
GitHub Action Run
30 run-3.2-gemfiles/rack_2_2.gemfile - 25361551546.30 05 May 2026 06:34AM UTC 156
95.62
GitHub Action Run
31 run-4.0-gemfiles/hashie.gemfile - 25361551546.31 05 May 2026 06:34AM UTC 156
62.58
GitHub Action Run
32 run-4.0-gemfiles/rack_3_2.gemfile - 25361551546.32 05 May 2026 06:35AM UTC 156
95.64
GitHub Action Run
33 run-4.0-gemfiles/rails_7_2.gemfile - 25361551546.33 05 May 2026 06:34AM UTC 157
95.65
GitHub Action Run
34 run-3.3-gemfiles/rails_8_1.gemfile - 25361551546.34 05 May 2026 06:34AM UTC 157
95.62
GitHub Action Run
35 run-4.0-gemfiles/dry_validation.gemfile - 25361551546.35 05 May 2026 06:35AM UTC 156
57.97
GitHub Action Run
36 run-3.2-gemfiles/rack_3_0.gemfile - 25361551546.36 05 May 2026 06:34AM UTC 156
95.67
GitHub Action Run
37 run-4.0-gemfiles/grape_entity.gemfile - 25361551546.37 05 May 2026 06:35AM UTC 156
49.75
GitHub Action Run
Source Files on build 25361551546
  • 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 #25361551546
  • Pull Request #2693
  • PR Base - master (#25361382857)
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