-
Hello 👋 Thank you 😄 |
Beta Was this translation helpful? Give feedback.
Answered by
nullndr
Jul 6, 2022
Replies: 1 comment 3 replies
-
You mean something like this? const schema = z.number();
try {
const data = schema.parse("foo");
} catch (e) {
if (e instanceof ZodError) {
console.log(e.issues);
}
} This will result in [
{
code: 'invalid_type',
expected: 'number',
received: 'string',
path: [],
message: 'Expected number, received string'
}
] |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
doteric
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You mean something like this?
This will result in