@@ -7,10 +7,9 @@ import {
77 isPrismaClientUnknownRequestError ,
88 isPrismaClientValidationError ,
99} from '@zenstackhq/runtime' ;
10- import { upperCaseFirst } from '@zenstackhq/runtime/local-helpers' ;
10+ import { upperCaseFirst , getZodErrorMessage } from '@zenstackhq/runtime/local-helpers' ;
1111import SuperJSON from 'superjson' ;
1212import { ZodError } from 'zod' ;
13- import { fromZodError } from 'zod-validation-error/v3' ;
1413import { Response } from '../../types' ;
1514import { APIHandlerBase , RequestContext } from '../base' ;
1615import { logError , registerCustomSerializers } from '../utils' ;
@@ -202,7 +201,8 @@ class RequestHandler extends APIHandlerBase {
202201 }
203202 }
204203
205- private makeError ( message : string , reason ?: string , zodErrors ?: ZodError ) {
204+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
205+ private makeError ( message : string , reason ?: string , zodErrors ?: ZodError < any > ) {
206206 // eslint-disable-next-line @typescript-eslint/no-explicit-any
207207 const error : any = { message, reason } ;
208208 if ( reason === CrudFailureReason . ACCESS_POLICY_VIOLATION || reason === CrudFailureReason . RESULT_NOT_READABLE ) {
@@ -251,7 +251,7 @@ class RequestHandler extends APIHandlerBase {
251251 } else {
252252 return {
253253 data : undefined ,
254- error : fromZodError ( parseResult . error ) . message ,
254+ error : getZodErrorMessage ( parseResult . error ) ,
255255 zodErrors : parseResult . error ,
256256 } ;
257257 }
0 commit comments