mirror of
https://github.com/withastro/astro.git
synced 2025-03-24 23:21:57 -05:00
Actions: include zod error in message for easier debugging (#11029)
* refactor: embed zod object in error msg * chore: changeset
This commit is contained in:
parent
8dfb1a23cc
commit
bd34452a34
2 changed files with 6 additions and 1 deletions
5
.changeset/modern-donkeys-taste.md
Normal file
5
.changeset/modern-donkeys-taste.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Actions: include validation error in thrown error message for debugging.
|
|
@ -110,7 +110,7 @@ export class ActionInputError<T extends ErrorInferenceObject> extends ActionErro
|
|||
fields: z.ZodError<T>['formErrors']['fieldErrors'];
|
||||
|
||||
constructor(issues: z.ZodIssue[]) {
|
||||
super({ message: 'Failed to validate', code: 'BAD_REQUEST' });
|
||||
super({ message: `Failed to validate: ${JSON.stringify(issues, null, 2)}`, code: 'BAD_REQUEST' });
|
||||
this.issues = issues;
|
||||
this.fields = {};
|
||||
for (const issue of issues) {
|
||||
|
|
Loading…
Add table
Reference in a new issue