chore: Couple fixes to improve error reporting (#16895)

* chore: Couple fixes to improve error reporting

* tweak: Fix error message

* refactor: Use findUniqueOrThrow instead of guard

* fix: Broken test, missing ID - suspect it passes because only one record exists

* chore: Minor refactor to split ZodEffect from ZodType

* fix: Satify typescript
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-10-01 09:18:51 -03:00
1 parent 4b6a389212
commit a95729f4a1
9 files changed
+31 -28

No files matched your search

@@ -28,7 +28,6 @@ function parseZodErrorIssues(issues: ZodIssue[]): string {
export function getServerErrorFromUnknown(cause: unknown): HttpError {
if (isZodError(cause)) {
console.log("cause", cause);
return new HttpError({
statusCode: 400,
message: parseZodErrorIssues(cause.issues),