@@ -34,7 +34,7 @@ const _extraErrorDataIntegration = ((options: Partial<ExtraErrorDataOptions> = {
3434 return {
3535 name : INTEGRATION_NAME ,
3636 processEvent ( event , hint , client ) {
37- const { maxValueLength = 250 } = client . getOptions ( ) ;
37+ const { maxValueLength } = client . getOptions ( ) ;
3838 return _enhanceEventWithErrorData ( event , hint , depth , captureErrorCause , maxValueLength ) ;
3939 } ,
4040 } ;
@@ -47,7 +47,7 @@ function _enhanceEventWithErrorData(
4747 hint : EventHint = { } ,
4848 depth : number ,
4949 captureErrorCause : boolean ,
50- maxValueLength : number ,
50+ maxValueLength : number | undefined ,
5151) : Event {
5252 if ( ! hint . originalException || ! isError ( hint . originalException ) ) {
5353 return event ;
@@ -85,7 +85,7 @@ function _enhanceEventWithErrorData(
8585function _extractErrorData (
8686 error : ExtendedError ,
8787 captureErrorCause : boolean ,
88- maxValueLength : number ,
88+ maxValueLength : number | undefined ,
8989) : Record < string , unknown > | null {
9090 // We are trying to enhance already existing event, so no harm done if it won't succeed
9191 try {
@@ -109,7 +109,12 @@ function _extractErrorData(
109109 continue ;
110110 }
111111 const value = error [ key ] ;
112- extraErrorInfo [ key ] = isError ( value ) || typeof value === 'string' ? truncate ( `${ value } ` , maxValueLength ) : value ;
112+ extraErrorInfo [ key ] =
113+ isError ( value ) || typeof value === 'string'
114+ ? maxValueLength
115+ ? truncate ( `${ value } ` , maxValueLength )
116+ : `${ value } `
117+ : value ;
113118 }
114119
115120 // Error.cause is a standard property that is non enumerable, we therefore need to access it separately.
0 commit comments