You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error reporting on zod parsing failures right now reports "Invalid response schema," which made debugging some stagehand test failures difficult. We can improve error handling by using a pattern like this:
const result = schema.safeParse(data);
if (!result.success) {
// log or rethrow with detail
throw new MyCustomError(result.error.format());
}
const parsed = result.data;
This would allow you to get more explicit guidance on why Zod schema parsing failed - example:
The error reporting on zod parsing failures right now reports "Invalid response schema," which made debugging some stagehand test failures difficult. We can improve error handling by using a pattern like this:
const result = schema.safeParse(data);
if (!result.success) {
// log or rethrow with detail
throw new MyCustomError(result.error.format());
}
const parsed = result.data;
This would allow you to get more explicit guidance on why Zod schema parsing failed - example:
{
name: { _errors: ['Required'] },
age: { _errors: ['Expected number, received string'] },
_errors: []
}
The text was updated successfully, but these errors were encountered: