add prompt schema validation debug logs (#17812)

This commit is contained in:
Kit Langton
2026-03-17 19:18:16 -04:00
committed by GitHub
parent 6c047391bb
commit fee3c196c5
2 changed files with 28 additions and 0 deletions

View File

@@ -7,6 +7,9 @@ export function fn<T extends z.ZodType, Result>(schema: T, cb: (input: z.infer<T
parsed = schema.parse(input)
} catch (e) {
console.trace("schema validation failure stack trace:")
if (e instanceof z.ZodError) {
console.error("schema validation issues:", JSON.stringify(e.issues, null, 2))
}
throw e
}