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

ruby-grape / grape / 36923789117
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: fix/error-raises
DEFAULT BRANCH: master
Ran 01 Oct 2026 08:44PM UTC
Jobs 17
Files 167
Run time 2min
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 Oct 2026 08:39PM UTC coverage: 99.545%. First build
36923789117

Pull #3023

github

ericproulx
Raise from error! instead of throwing :error

error! threw :error, and a throw is not an exception. Active Record
commits a transaction that a throw leaves, so error! inside a
transaction saved what the block had written while the client was told
the request failed. A throw cannot leave the fiber it was thrown in
either, so error! inside an Async task answered 500.

error! now raises Grape::Exceptions::Halt, a StandardError carrying the
same ErrorResponse. The error middleware takes it inside its catch, so
it is rendered where a thrown error is and never reaches rescue_from.
Its backtrace is preset empty, as Validation's is, so raise skips
capturing one.

Raising costs more than throwing, so ErrorResponse is now a plain
frozen class rather than a Data. Every error response builds at least
two of them, and Data's constructor takes its keywords as a Hash it
then validates: about 450 ns each and 700 ns for #with, against about
120 ns. It keeps what Data answered that a value object is used
through: readers, #with, #to_h, #members, equality and hashing, pattern
matching, and being frozen. Halt spells its keywords out for the same
reason. With both, an error! response is at least as fast as before,
and other error responses are faster.

throw :error from middleware and rescue_from handlers keeps working.

Fixes #2197

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull Request #3023: Raise from error! instead of throwing :error

1503 of 1513 branches covered (99.34%)

Branch coverage included in aggregate %.

41 of 42 new or added lines in 4 files covered. (97.62%)

4408 of 4425 relevant lines covered (99.62%)

15965.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.73
lib/grape/exceptions/error_response.rb
Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_3_0.gemfile - 36923789117.1 01 Oct 2026 08:44PM UTC 166
98.79
GitHub Action Run
2 run-4.0-gemfiles/multi_json_1_20.gemfile - 36923789117.2 01 Oct 2026 08:45PM UTC 165
45.9
GitHub Action Run
3 run-3.3-gemfiles/rails_8_0.gemfile - 36923789117.3 01 Oct 2026 08:44PM UTC 167
98.8
GitHub Action Run
4 run-4.0-Gemfile - 36923789117.4 01 Oct 2026 08:45PM UTC 166
98.79
GitHub Action Run
5 run-3.3-gemfiles/rails_7_2.gemfile - 36923789117.5 01 Oct 2026 08:45PM UTC 167
98.8
GitHub Action Run
6 run-3.3-gemfiles/rails_8_1.gemfile - 36923789117.6 01 Oct 2026 08:45PM UTC 167
98.8
GitHub Action Run
7 run-3.4-gemfiles/rack_3_2.gemfile - 36923789117.7 01 Oct 2026 08:44PM UTC 166
98.79
GitHub Action Run
8 run-3.4-gemfiles/rack_2_2.gemfile - 36923789117.8 01 Oct 2026 08:44PM UTC 166
98.75
GitHub Action Run
9 run-3.3-Gemfile - 36923789117.9 01 Oct 2026 08:44PM UTC 166
98.8
GitHub Action Run
10 run-3.3-gemfiles/rack_3_0.gemfile - 36923789117.10 01 Oct 2026 08:45PM UTC 166
98.8
GitHub Action Run
11 run-3.3-gemfiles/rack_3_1.gemfile - 36923789117.11 01 Oct 2026 08:45PM UTC 166
98.8
GitHub Action Run
12 run-4.0-gemfiles/rails_7_2.gemfile - 36923789117.12 01 Oct 2026 08:44PM UTC 167
98.79
GitHub Action Run
13 run-4.0-gemfiles/multi_xml.gemfile - 36923789117.13 01 Oct 2026 08:44PM UTC 165
45.56
GitHub Action Run
14 run-4.0-gemfiles/grape_swagger.gemfile - 36923789117.14 01 Oct 2026 08:45PM UTC 165
53.08
GitHub Action Run
15 run-4.0-gemfiles/dry_validation.gemfile - 36923789117.15 01 Oct 2026 08:45PM UTC 165
55.76
GitHub Action Run
16 run-3.4-Gemfile - 36923789117.16 01 Oct 2026 08:45PM UTC 166
98.79
GitHub Action Run
17 run-4.0-gemfiles/rails_8_1.gemfile - 36923789117.17 01 Oct 2026 08:44PM UTC 167
98.79
GitHub Action Run
Source Files on build 36923789117
  • Tree
  • List 167
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36923789117
  • Pull Request #3023
  • PR Base - master (#36827966839)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc