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

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

Build:
Build:
LAST BUILD BRANCH: perf/build-headers-each-header
DEFAULT BRANCH: master
Ran 22 Apr 2026 01:34AM 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

22 Apr 2026 01:33AM UTC coverage: 96.953% (-0.03%) from 96.983%
24755531894

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 existed solely
to make `error_response` work uniformly.

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

Removed `Grape::Exceptions::Base#[]`. Code that read `exception[:status]`
must switch to `exception.status` — 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.

3374 of 3429 relevant lines covered (98.4%)

32022.76 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.2-gemfiles/rails_8_0.gemfile - 24755531894.1 22 Apr 2026 01:34AM UTC 156
95.66
GitHub Action Run
2 run-3.3-gemfiles/rails_7_2.gemfile - 24755531894.2 22 Apr 2026 01:34AM UTC 156
95.62
GitHub Action Run
3 run-3.4-gemfiles/rack_2_2.gemfile - 24755531894.3 22 Apr 2026 01:34AM UTC 155
95.59
GitHub Action Run
4 run-3.4-gemfiles/rails_8_1.gemfile - 24755531894.4 22 Apr 2026 01:34AM UTC 156
95.64
GitHub Action Run
5 run-4.0-gemfiles/rack_3_2.gemfile - 24755531894.5 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
6 run-4.0-gemfiles/grape_entity.gemfile - 24755531894.6 22 Apr 2026 01:34AM UTC 155
49.52
GitHub Action Run
7 run-3.4-gemfiles/rack_3_1.gemfile - 24755531894.7 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
8 run-3.4-gemfiles/rack_3_0.gemfile - 24755531894.8 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
9 run-4.0-gemfiles/dry_validation.gemfile - 24755531894.9 22 Apr 2026 01:34AM UTC 155
57.79
GitHub Action Run
10 run-3.3-gemfiles/rails_8_0.gemfile - 24755531894.10 22 Apr 2026 01:34AM UTC 156
95.62
GitHub Action Run
11 run-3.3-gemfiles/rails_8_1.gemfile - 24755531894.11 22 Apr 2026 01:35AM UTC 156
95.62
GitHub Action Run
12 run-3.4-gemfiles/rails_8_0.gemfile - 24755531894.12 22 Apr 2026 01:34AM UTC 156
95.64
GitHub Action Run
13 run-4.0-gemfiles/rack_3_0.gemfile - 24755531894.13 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
14 run-4.0-gemfiles/rack_2_2.gemfile - 24755531894.14 22 Apr 2026 01:34AM UTC 155
95.59
GitHub Action Run
15 run-3.3-gemfiles/rack_3_1.gemfile - 24755531894.15 22 Apr 2026 01:34AM UTC 155
95.62
GitHub Action Run
16 run-4.0-gemfiles/rack_3_1.gemfile - 24755531894.16 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
17 run-3.4-gemfiles/rails_7_2.gemfile - 24755531894.17 22 Apr 2026 01:34AM UTC 156
95.64
GitHub Action Run
18 run-3.3-gemfiles/rack_2_2.gemfile - 24755531894.18 22 Apr 2026 01:35AM UTC 155
95.57
GitHub Action Run
19 run-3.4-gemfiles/rack_3_2.gemfile - 24755531894.19 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
20 run-3.2-Gemfile - 24755531894.20 22 Apr 2026 01:34AM UTC 155
95.66
GitHub Action Run
21 run-4.0-gemfiles/rails_8_0.gemfile - 24755531894.21 22 Apr 2026 01:34AM UTC 156
95.64
GitHub Action Run
22 run-4.0-gemfiles/hashie.gemfile - 24755531894.22 22 Apr 2026 01:34AM UTC 155
62.46
GitHub Action Run
23 run-3.2-gemfiles/rack_3_1.gemfile - 24755531894.23 22 Apr 2026 01:34AM UTC 155
95.66
GitHub Action Run
24 run-4.0-gemfiles/rails_7_2.gemfile - 24755531894.24 22 Apr 2026 01:35AM UTC 156
95.64
GitHub Action Run
25 run-3.2-gemfiles/rack_3_2.gemfile - 24755531894.25 22 Apr 2026 01:34AM UTC 155
95.66
GitHub Action Run
26 run-3.3-Gemfile - 24755531894.26 22 Apr 2026 01:34AM UTC 155
95.62
GitHub Action Run
27 run-3.3-gemfiles/rack_3_2.gemfile - 24755531894.27 22 Apr 2026 01:34AM UTC 155
95.62
GitHub Action Run
28 run-3.3-gemfiles/rack_3_0.gemfile - 24755531894.28 22 Apr 2026 01:34AM UTC 155
95.62
GitHub Action Run
29 run-4.0-gemfiles/rails_8_1.gemfile - 24755531894.29 22 Apr 2026 01:34AM UTC 156
95.64
GitHub Action Run
30 run-4.0-Gemfile - 24755531894.30 22 Apr 2026 01:34AM UTC 155
95.64
GitHub Action Run
31 run-4.0-gemfiles/multi_xml.gemfile - 24755531894.31 22 Apr 2026 01:34AM UTC 155
35.91
GitHub Action Run
32 run-3.4-Gemfile - 24755531894.32 22 Apr 2026 01:35AM UTC 155
95.64
GitHub Action Run
33 run-3.2-gemfiles/rack_2_2.gemfile - 24755531894.33 22 Apr 2026 01:34AM UTC 155
95.62
GitHub Action Run
34 run-3.2-gemfiles/rails_8_1.gemfile - 24755531894.34 22 Apr 2026 01:34AM UTC 156
95.66
GitHub Action Run
35 run-3.2-gemfiles/rails_7_2.gemfile - 24755531894.35 22 Apr 2026 01:34AM UTC 156
95.66
GitHub Action Run
36 run-4.0-gemfiles/multi_json.gemfile - 24755531894.36 22 Apr 2026 01:34AM UTC 155
35.91
GitHub Action Run
37 run-3.2-gemfiles/rack_3_0.gemfile - 24755531894.37 22 Apr 2026 01:34AM UTC 155
95.66
GitHub Action Run
Source Files on build 24755531894
  • Tree
  • List 156
  • Changed 6
  • Source Changed 6
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #24755531894
  • Pull Request #2693
  • PR Base - master (#24754841764)
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