Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/path-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export default function parsePathParams<I, O>(source?: I, schema?: ZodType<O, Zo
// eslint-disable-next-line no-console
console.log((error as ZodError).issues);
}
throw new Error("PARSE_PATH_PARAMS");
throw new Error("PARSE_PATH_PARAMS", { cause: (error as ZodError).issues });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically in this case, ZodError will always be there since it's going to be the error type of safeParse.

In the future, perhaps we can structure this function in such a way that the error will always be a ZodError without relying on type assertions! 👍

}
}