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

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

Build:
Build:
LAST BUILD BRANCH: perf/skip-default-version-pattern
DEFAULT BRANCH: master
Ran 31 Aug 2026 10:34AM UTC
Jobs 32
Files 169
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

31 Aug 2026 10:24AM UTC coverage: 96.943% (-0.04%) from 96.978%
33382241712

Pull #2878

github

ericproulx
Build an error response's backtrace only when it will be rendered

Every error response materialized the exception's backtrace.
`ErrorResponse.from_exception` read `exception.backtrace` to store it, and
`Middleware::Error#error_response` re-derived it with
`raw.backtrace || raw.original_exception&.backtrace || []`.

`Exception#backtrace` is not a field read: it converts the captured frames into
an Array of location Strings, one per frame, and a Grape error is raised deep
inside the validation stack. Meanwhile every built-in error formatter drops the
result unless the API asked for it:

    wrapped_message[:backtrace] = error.backtrace if include_backtrace && ...

and `include_backtrace` is `rescue_from ..., backtrace: true`, off by default.
So the common 400 paid to build a backtrace that was then discarded.

`from_exception` no longer reads it — the exception travels on the payload as
`original_exception`, so nothing is lost — and `error_response` assembles one
only when `include_backtrace` is set.

On a small API answering a validation failure (400 Bad Request), median of 9
interleaved runs, Ruby 4.0.5 with YJIT:

    8,749 -> 11,878 req/s   (+36%)
    333 -> 266 objects per request

`rescue_from ..., backtrace: true` and `original_exception: true` render exactly
as before; the specs covering both are unchanged.

A custom error formatter that reads `error.backtrace` while ignoring the
`include_backtrace:` argument it is passed now receives an empty Array. It still
has `error.original_exception` and can call `#backtrace` on that itself. See
UPGRADING.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2878: Build an error response's backtrace only when it will be rendered

1238 of 1332 branches covered (92.94%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

3900 of 3968 relevant lines covered (98.29%)

27145.18 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rack_3_2.gemfile - 33382241712.1 31 Aug 2026 10:35AM UTC 168
95.69
GitHub Action Run
2 run-4.0-gemfiles/rack_3_0.gemfile - 33382241712.2 31 Aug 2026 10:35AM UTC 168
95.69
GitHub Action Run
3 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33382241712.3 31 Aug 2026 10:36AM UTC 168
46.81
GitHub Action Run
4 run-3.3-gemfiles/rails_8_0.gemfile - 33382241712.4 31 Aug 2026 10:36AM UTC 169
95.7
GitHub Action Run
5 run-4.0-gemfiles/multi_json.gemfile - 33382241712.5 31 Aug 2026 10:36AM UTC 168
47.37
GitHub Action Run
6 run-3.3-Gemfile - 33382241712.6 31 Aug 2026 10:35AM UTC 168
95.69
GitHub Action Run
7 run-4.0-Gemfile - 33382241712.7 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
8 run-3.4-gemfiles/rack_3_0.gemfile - 33382241712.8 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
9 run-3.4-gemfiles/rails_7_2.gemfile - 33382241712.9 31 Aug 2026 10:36AM UTC 169
95.7
GitHub Action Run
10 run-4.0-gemfiles/rails_7_2.gemfile - 33382241712.10 31 Aug 2026 10:37AM UTC 169
95.7
GitHub Action Run
11 run-4.0-gemfiles/dry_validation.gemfile - 33382241712.11 31 Aug 2026 10:34AM UTC 168
57.8
GitHub Action Run
12 run-4.0-gemfiles/hashie.gemfile - 33382241712.12 31 Aug 2026 10:35AM UTC 168
61.64
GitHub Action Run
13 run-4.0-gemfiles/grape_swagger.gemfile - 33382241712.13 31 Aug 2026 10:35AM UTC 168
55.16
GitHub Action Run
14 run-4.0-gemfiles/multi_xml.gemfile - 33382241712.14 31 Aug 2026 10:34AM UTC 168
46.77
GitHub Action Run
15 run-4.0-gemfiles/rails_8_0.gemfile - 33382241712.15 31 Aug 2026 10:36AM UTC 169
95.7
GitHub Action Run
16 run-3.4-gemfiles/rack_3_1.gemfile - 33382241712.16 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
17 run-3.4-gemfiles/rails_8_0.gemfile - 33382241712.17 31 Aug 2026 10:34AM UTC 169
95.7
GitHub Action Run
18 run-3.3-gemfiles/rails_8_1.gemfile - 33382241712.18 31 Aug 2026 10:37AM UTC 169
95.7
GitHub Action Run
19 run-3.3-gemfiles/rack_3_1.gemfile - 33382241712.19 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
20 run-3.3-gemfiles/rack_3_0.gemfile - 33382241712.20 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
21 run-4.0-gemfiles/rails_8_1.gemfile - 33382241712.21 31 Aug 2026 10:34AM UTC 169
95.7
GitHub Action Run
22 run-3.4-gemfiles/rack_2_2.gemfile - 33382241712.22 31 Aug 2026 10:37AM UTC 168
95.66
GitHub Action Run
23 run-3.3-gemfiles/rails_7_2.gemfile - 33382241712.23 31 Aug 2026 10:37AM UTC 169
95.7
GitHub Action Run
24 run-4.0-gemfiles/multi_json_1_20.gemfile - 33382241712.24 31 Aug 2026 10:35AM UTC 168
47.41
GitHub Action Run
25 run-3.4-Gemfile - 33382241712.25 31 Aug 2026 10:35AM UTC 168
95.69
GitHub Action Run
26 run-4.0-gemfiles/grape_entity.gemfile - 33382241712.26 31 Aug 2026 10:37AM UTC 168
50.09
GitHub Action Run
27 run-4.0-gemfiles/rack_3_2.gemfile - 33382241712.27 31 Aug 2026 10:37AM UTC 168
95.69
GitHub Action Run
28 run-3.4-gemfiles/rails_8_1.gemfile - 33382241712.28 31 Aug 2026 10:37AM UTC 169
95.7
GitHub Action Run
29 run-3.3-gemfiles/rack_3_2.gemfile - 33382241712.29 31 Aug 2026 10:36AM UTC 168
95.69
GitHub Action Run
30 run-4.0-gemfiles/rack_2_2.gemfile - 33382241712.30 31 Aug 2026 10:34AM UTC 168
95.66
GitHub Action Run
31 run-4.0-gemfiles/rack_3_1.gemfile - 33382241712.31 31 Aug 2026 10:35AM UTC 168
95.69
GitHub Action Run
32 run-3.3-gemfiles/rack_2_2.gemfile - 33382241712.32 31 Aug 2026 10:36AM UTC 168
95.65
GitHub Action Run
Source Files on build 33382241712
  • Tree
  • List 169
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33382241712
  • Pull Request #2878
  • PR Base - master (#33365105943)
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