Commit 95614ad
committed
fix(api): surface schema validation failures as ApiError instead of ZodError
schema.parse() in apiRequestToRegion could throw a raw ZodError on
unexpected API response shapes, which the central error handler would
display as an 'Unexpected error' stack trace. Use safeParse() instead
and convert failures to ApiError so they surface as clean user-facing
error messages regardless of which command triggered the request.1 parent c373529 commit 95614ad
1 file changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | 308 | | |
310 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
311 | 325 | | |
312 | 326 | | |
313 | 327 | | |
| |||
0 commit comments