File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/large-response-middleware/src Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,14 @@ export const withLargeResponseHandler = ({
103
103
response_size_mb : contentLengthMB . toFixed ( 2 ) ,
104
104
$payload_ref,
105
105
} ) ;
106
-
107
106
response . isBase64Encoded = false ;
108
107
response . statusCode = 413 ;
108
+ const responseErrorMessage = customErrorMessage ?? LARGE_RESPONSE_USER_INFO ;
109
+
109
110
response . body = JSON . stringify ( {
110
- message : customErrorMessage
111
- ? typeof customErrorMessage === 'string'
112
- ? customErrorMessage
113
- : customErrorMessage ( event )
114
- : LARGE_RESPONSE_USER_INFO ,
111
+ message : typeof responseErrorMessage === 'string'
112
+ ? responseErrorMessage
113
+ : customErrorMessage ?.( event ) || customErrorMessage ,
115
114
} ) ;
116
115
}
117
116
} else if ( contentLengthMB > thresholdWarnInMB ) {
You can’t perform that action at this time.
0 commit comments