(error: unknown, requestId: string, context: string)
| 755 | } |
| 756 | |
| 757 | function handleResponseSizeLimitError(error: unknown, requestId: string, context: string): boolean { |
| 758 | if (!isPayloadSizeLimitError(error)) return false |
| 759 | |
| 760 | logger.error(`[${requestId}] Response body size limit exceeded for ${context}:`, { |
| 761 | label: error.label, |
| 762 | maxBytes: error.maxBytes, |
| 763 | observedBytes: error.observedBytes, |
| 764 | }) |
| 765 | throw new Error(RESPONSE_SIZE_LIMIT_ERROR_MESSAGE) |
| 766 | } |
| 767 | |
| 768 | function cloneResponseHeaders(headers: Headers | HeadersInit | undefined): Headers { |
| 769 | const clonedHeaders = new Headers() |
no test coverage detected