Commit a4335cc
fix(llmo-config): polish LlmoConfigValidationError per review
Address minor polish items from PR #1574 review:
- Pass { cause: zodError } to super() so the original ZodError stack is
preserved on the cause chain. Improves debuggability without changing
the public error shape.
- Use issue `code` instead of `message` in the summary string. Zod's
default messages can echo received values, and the LLMO config can
carry user-curated content (brand names, competitor URLs) on the
api-service write path. The full human-readable detail (including the
values) remains on `this.issues` for trusted callers to inspect.
- Lock down the message-format contract with a regex assertion so the
path-shape (e.g. categories.<uuid>.region) is not silently dropped by
a future maintainer.
- Switch the test fixture UUID to a v4-conformant value so Zod's
validation reaches the inner field rather than failing at the record
key.
Refs: SITES-43238
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 208d7dc commit a4335cc
2 files changed
Lines changed: 19 additions & 5 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | | - | |
| 34 | + | |
31 | 35 | | |
32 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
246 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
0 commit comments