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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 01 May 2026 12:57PM UTC
Jobs 37
Files 156
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 May 2026 12:56PM UTC coverage: 96.951% (-0.03%) from 96.98%
25215069391

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

37 of 39 new or added lines in 6 files covered. (94.87%)

1 existing line in 1 file now uncovered.

3371 of 3426 relevant lines covered (98.39%)

32047.23 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
93.88
-2.0% lib/grape/middleware/error.rb

Coverage Regressions

Lines Coverage ∆ File
1
93.88
-2.0% lib/grape/middleware/error.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_3_0.gemfile - 25215069391.1 01 May 2026 12:57PM UTC 155
95.61
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 25215069391.2 01 May 2026 12:58PM UTC 155
62.52
GitHub Action Run
3 run-3.2-gemfiles/rack_2_2.gemfile - 25215069391.3 01 May 2026 12:57PM UTC 155
95.61
GitHub Action Run
4 run-3.4-gemfiles/rack_3_0.gemfile - 25215069391.4 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
5 run-3.3-gemfiles/rack_2_2.gemfile - 25215069391.5 01 May 2026 12:57PM UTC 155
95.57
GitHub Action Run
6 run-3.2-gemfiles/rails_7_2.gemfile - 25215069391.6 01 May 2026 12:57PM UTC 156
95.66
GitHub Action Run
7 run-3.4-gemfiles/rack_3_2.gemfile - 25215069391.7 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
8 run-4.0-Gemfile - 25215069391.8 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
9 run-3.4-Gemfile - 25215069391.9 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
10 run-3.4-gemfiles/rack_3_1.gemfile - 25215069391.10 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
11 run-4.0-gemfiles/dry_validation.gemfile - 25215069391.11 01 May 2026 12:58PM UTC 155
57.85
GitHub Action Run
12 run-3.2-gemfiles/rack_3_1.gemfile - 25215069391.12 01 May 2026 12:57PM UTC 155
95.66
GitHub Action Run
13 run-3.3-gemfiles/rails_8_0.gemfile - 25215069391.13 01 May 2026 12:57PM UTC 156
95.62
GitHub Action Run
14 run-4.0-gemfiles/rails_8_1.gemfile - 25215069391.14 01 May 2026 12:58PM UTC 156
95.64
GitHub Action Run
15 run-3.4-gemfiles/rails_8_1.gemfile - 25215069391.15 01 May 2026 12:57PM UTC 156
95.64
GitHub Action Run
16 run-3.3-gemfiles/rack_3_2.gemfile - 25215069391.16 01 May 2026 12:57PM UTC 155
95.61
GitHub Action Run
17 run-3.3-gemfiles/rack_3_1.gemfile - 25215069391.17 01 May 2026 12:57PM UTC 155
95.61
GitHub Action Run
18 run-3.3-Gemfile - 25215069391.18 01 May 2026 12:57PM UTC 155
95.61
GitHub Action Run
19 run-4.0-gemfiles/rails_7_2.gemfile - 25215069391.19 01 May 2026 12:58PM UTC 156
95.64
GitHub Action Run
20 run-4.0-gemfiles/rack_2_2.gemfile - 25215069391.20 01 May 2026 12:57PM UTC 155
95.59
GitHub Action Run
21 run-3.2-gemfiles/rails_8_1.gemfile - 25215069391.21 01 May 2026 12:57PM UTC 156
95.66
GitHub Action Run
22 run-4.0-gemfiles/multi_xml.gemfile - 25215069391.22 01 May 2026 12:57PM UTC 155
35.95
GitHub Action Run
23 run-4.0-gemfiles/multi_json.gemfile - 25215069391.23 01 May 2026 12:58PM UTC 155
35.95
GitHub Action Run
24 run-3.2-gemfiles/rack_3_2.gemfile - 25215069391.24 01 May 2026 12:57PM UTC 155
95.66
GitHub Action Run
25 run-3.2-gemfiles/rails_8_0.gemfile - 25215069391.25 01 May 2026 12:57PM UTC 156
95.66
GitHub Action Run
26 run-3.4-gemfiles/rails_8_0.gemfile - 25215069391.26 01 May 2026 12:57PM UTC 156
95.64
GitHub Action Run
27 run-3.2-gemfiles/rack_3_0.gemfile - 25215069391.27 01 May 2026 12:57PM UTC 155
95.66
GitHub Action Run
28 run-3.2-Gemfile - 25215069391.28 01 May 2026 12:57PM UTC 155
95.66
GitHub Action Run
29 run-3.4-gemfiles/rails_7_2.gemfile - 25215069391.29 01 May 2026 12:57PM UTC 156
95.64
GitHub Action Run
30 run-3.4-gemfiles/rack_2_2.gemfile - 25215069391.30 01 May 2026 12:57PM UTC 155
95.59
GitHub Action Run
31 run-4.0-gemfiles/rails_8_0.gemfile - 25215069391.31 01 May 2026 12:58PM UTC 156
95.64
GitHub Action Run
32 run-4.0-gemfiles/rack_3_1.gemfile - 25215069391.32 01 May 2026 12:58PM UTC 155
95.63
GitHub Action Run
33 run-4.0-gemfiles/rack_3_2.gemfile - 25215069391.33 01 May 2026 12:58PM UTC 155
95.63
GitHub Action Run
34 run-3.3-gemfiles/rails_8_1.gemfile - 25215069391.34 01 May 2026 12:58PM UTC 156
95.62
GitHub Action Run
35 run-3.3-gemfiles/rails_7_2.gemfile - 25215069391.35 01 May 2026 12:57PM UTC 156
95.62
GitHub Action Run
36 run-4.0-gemfiles/grape_entity.gemfile - 25215069391.36 01 May 2026 12:58PM UTC 155
49.57
GitHub Action Run
37 run-4.0-gemfiles/rack_3_0.gemfile - 25215069391.37 01 May 2026 12:57PM UTC 155
95.63
GitHub Action Run
Source Files on build 25215069391
  • Tree
  • List 156
  • 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 #25215069391
  • Pull Request #2693
  • PR Base - master (#25137726391)
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