File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -529,10 +529,16 @@ export async function apiRequestToRegion<T>(
529529 // Attach structured validation issues to the Sentry event so we can
530530 // diagnose exactly which field(s) failed validation — the ApiError.detail
531531 // string alone may not be visible in the Sentry issue overview.
532+ // Strip valibot issues to metadata only (path/type/message) before
533+ // attaching — full issues embed the raw failing `input` value.
532534 Sentry . setContext ( "schema_validation" , {
533535 endpoint,
534536 status : response . status ,
535- issues : result . issues . slice ( 0 , 10 ) ,
537+ issues : result . issues . slice ( 0 , 10 ) . map ( ( i ) => ( {
538+ path : i . path ,
539+ type : i . type ,
540+ message : i . message ,
541+ } ) ) ,
536542 } ) ;
537543 throw new ApiError (
538544 `Unexpected response format from ${ endpoint } ` ,
Original file line number Diff line number Diff line change @@ -98,9 +98,15 @@ function safeParseResponse<T>(
9898 assertObjectResponse ( data , context ) ;
9999 const result = safeParse ( schema , data ) ;
100100 if ( ! result . success ) {
101+ // Strip valibot issues to metadata only (path/type/message) before
102+ // attaching to Sentry — full issues embed the raw failing `input` value.
101103 Sentry . setContext ( "schema_validation" , {
102104 context,
103- issues : result . issues . slice ( 0 , 10 ) ,
105+ issues : result . issues . slice ( 0 , 10 ) . map ( ( i ) => ( {
106+ path : i . path ,
107+ type : i . type ,
108+ message : i . message ,
109+ } ) ) ,
104110 } ) ;
105111 throw new ApiError (
106112 `${ context } : unexpected response format` ,
You can’t perform that action at this time.
0 commit comments