Repository navigation
Commit 76a053e
committed
fix(spec): keep defineForm's option-value refusal an Error with a stack
The refusal was rebuilt with `new z.ZodError(...)`, which in zod v4 classic
is a trait object with no `Error` parent and no `stack`: an uncaught
module-load throw printed `ZodError { name, message: [Getter/Setter] }` and
hid the issues and the remedy. It is now a `z.ZodRealError` built from the
remedied issue copies, with its trace captured at the `defineForm` call
(zod builds every ZodRealError with `Error.stackTraceLimit = 0` and captures
a trace only in `parse`, so the parse's own `safeParse` error carries no
frame either).
The refusal pin now asserts an `Error`, a string `stack`, and a frame in the
calling module; a new case reads the printed wall (the stack's head) for the
grammar message and the remedy.
Claude-Session: https://claude.ai/code/session_013RDBh5DqXd2xnLwvHLgLFr
Co-authored-by: Claude <noreply@anthropic.com>1 parent 74ea5db commit 76a053e
2 files changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
| |||
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| |||
201 | 217 | | |
202 | 218 | | |
203 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
204 | 233 | | |
205 | 234 | | |
206 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6369 | 6369 | | |
6370 | 6370 | | |
6371 | 6371 | | |
6372 | | - | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
| 6376 | + | |
| 6377 | + | |
| 6378 | + | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
| 6382 | + | |
| 6383 | + | |
6373 | 6384 | | |
6374 | 6385 | | |
6375 | 6386 | | |
| |||
0 commit comments