MCPcopy
hub / github.com/simstudioai/sim / handleResponseSizeLimitError

Function handleResponseSizeLimitError

apps/sim/tools/index.ts:757–766  ·  view source on GitHub ↗
(error: unknown, requestId: string, context: string)

Source from the content-addressed store, hash-verified

755}
756
757function 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
768function cloneResponseHeaders(headers: Headers | HeadersInit | undefined): Headers {
769 const clonedHeaders = new Headers()

Callers 1

executeToolRequestFunction · 0.85

Calls 2

isPayloadSizeLimitErrorFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected