File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @vesselapi/integrations" ,
3- "version" : " 1.0.41 " ,
3+ "version" : " 1.0.42 " ,
44 "description" : " Vessel integrations" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.mjs" ,
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ export const formatUrl = (
5757 : ( url as `${HttpsUrl } /${string } `) ;
5858} ;
5959
60+ const customErrorMap : z . ZodErrorMap = ( _ , ctx ) => {
61+ return {
62+ message : `${ ctx . defaultError } . Received value: ${ ctx . data } ` ,
63+ } ;
64+ } ;
65+
6066export const toBase64 = ( str : string ) => Buffer . from ( str ) . toString ( 'base64' ) ;
6167
6268const _requestWithAxios = async ( {
@@ -219,7 +225,9 @@ export const makeRequestFactory = (
219225 } ) ;
220226 }
221227
222- const zodResult = await response . options . schema . safeParseAsync ( body ) ;
228+ const zodResult = await response . options . schema . safeParseAsync ( body , {
229+ errorMap : customErrorMap ,
230+ } ) ;
223231 if ( ! zodResult . success ) {
224232 if ( options . strict ) {
225233 throw new IntegrationError ( 'Validation failed on client response' , {
You can’t perform that action at this time.
0 commit comments