Skip to content

Commit 688887f

Browse files
committed
fix: use zod error message for useFindSessionQuery
1 parent 623c2e9 commit 688887f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/web/src/hooks/useFindSessionQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export const useFindSessionQuery = (
2828
});
2929
const parsedData = $SessionWithUser.array().safeParseAsync(response.data);
3030
if ((await parsedData).error) {
31-
throw new Error(`cant find data`);
31+
const message = (await parsedData).error?.message;
32+
throw new Error(message);
3233
}
3334
return (await parsedData).data;
3435
},

0 commit comments

Comments
 (0)