Commit 076dd8f
fix: refactor formatExceptionMessage to accept generic request context (#2877)
- Renamed `renderingRequest` parameter to `requestDescription` in
`formatExceptionMessage`
- Changed the hardcoded label from `"JS code for rendering request
was:"` to the neutral `"Request:"`
- Updated JSDoc to reflect the broader usage
Closes #2858
`formatExceptionMessage` was originally written for the render endpoint
and hardcoded the label `"JS code for rendering request was:"`. Since
the `/upload-assets` endpoint now also calls it (via lock-failure
handling) with a task description string like `"Uploading bundles
[server.js] with assets [stats.json]"`, this produced misleading error
logs. The fix uses a generic label that works for both use cases.
All 11 call sites already pass a `string`, so no caller changes were
needed.
- [x] TypeScript type-check passes (`pnpm run --filter
react-on-rails-pro-node-renderer type-check`)
- [x] ESLint passes on the changed file
- [x] Package builds successfully (`pnpm run --filter
react-on-rails-pro-node-renderer build`)
- [x] Verified all 11 call sites — no caller changes required
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
* **Bug Fixes**
* Improved rendering error messages to clearly show the request context,
choosing a descriptive label when a JS rendering snippet is present or
using a provided custom label/content.
* Simplified the default label to "Request:" where applicable.
* Trimmed and cleaned surrounding whitespace/newlines so error snippets
and overall output are easier to read.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9f9763f commit 076dd8f
3 files changed
Lines changed: 31 additions & 14 deletions
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
72 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
| |||
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | | - | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| |||
158 | 167 | | |
159 | 168 | | |
160 | 169 | | |
161 | | - | |
| 170 | + | |
162 | 171 | | |
163 | 172 | | |
164 | 173 | | |
| |||
241 | 250 | | |
242 | 251 | | |
243 | 252 | | |
244 | | - | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
247 | 256 | | |
| |||
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
270 | | - | |
| 279 | + | |
271 | 280 | | |
272 | 281 | | |
273 | 282 | | |
| |||
0 commit comments