Skip to content

Commit

Permalink
Merge pull request #36 from IdoPesok/string-errors
Browse files Browse the repository at this point in the history
string errors and changeset
  • Loading branch information
IdoPesok authored May 26, 2024
2 parents 44fbee1 + 45955d9 commit 4db0e93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/happy-flowers-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"zsa": patch
---

Fix string errors to not be stringified
5 changes: 4 additions & 1 deletion packages/zsa/src/zod-safe-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,10 @@ export class ZodSafeFunction<
return [
null,
{
data: JSON.stringify(customError.data),
data:
typeof customError.data === "string"
? customError.data
: JSON.stringify(customError.data),
name: customError.name,
stack: JSON.stringify(customError.stack),
message: JSON.stringify(customError.message),
Expand Down

0 comments on commit 4db0e93

Please sign in to comment.