File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @vesselapi/integrations" ,
3
- "version" : " 1.0.41 " ,
3
+ "version" : " 1.0.42 " ,
4
4
"description" : " Vessel integrations" ,
5
5
"main" : " dist/index.js" ,
6
6
"module" : " dist/index.mjs" ,
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ export const formatUrl = (
57
57
: ( url as `${HttpsUrl } /${string } `) ;
58
58
} ;
59
59
60
+ const customErrorMap : z . ZodErrorMap = ( _ , ctx ) => {
61
+ return {
62
+ message : `${ ctx . defaultError } . Received value: ${ ctx . data } ` ,
63
+ } ;
64
+ } ;
65
+
60
66
export const toBase64 = ( str : string ) => Buffer . from ( str ) . toString ( 'base64' ) ;
61
67
62
68
const _requestWithAxios = async ( {
@@ -219,7 +225,9 @@ export const makeRequestFactory = (
219
225
} ) ;
220
226
}
221
227
222
- const zodResult = await response . options . schema . safeParseAsync ( body ) ;
228
+ const zodResult = await response . options . schema . safeParseAsync ( body , {
229
+ errorMap : customErrorMap ,
230
+ } ) ;
223
231
if ( ! zodResult . success ) {
224
232
if ( options . strict ) {
225
233
throw new IntegrationError ( 'Validation failed on client response' , {
You can’t perform that action at this time.
0 commit comments