{"record":{"id":"835010ff5d253d1a","repo":"diegosouzapw/OmniRoute","slug":"remote-image-exceeds-maxbytes-byte-limit","errorCode":null,"errorMessage":"Remote image exceeds ${maxBytes} byte limit","messagePattern":"Remote image exceeds (.+?) byte limit","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/network/remoteImageFetch.ts","lineNumber":147,"sourceCode":"        ...(init as Parameters<typeof undiciFetch>[1]),\n        dispatcher,\n      })) as unknown as Response;\n    } finally {\n      await dispatcher.close();\n    }\n  }) as typeof fetch;\n}\nfunction combineSignals(signal: AbortSignal | undefined, timeoutMs: number) {\n  const timeoutSignal = AbortSignal.timeout(timeoutMs);\n  if (!signal) return timeoutSignal;\n  return AbortSignal.any([signal, timeoutSignal]);\n}\n\nasync function readResponseBuffer(response: Response, maxBytes: number) {\n  const contentLengthHeader = response.headers.get(\"content-length\");\n  const contentLength = contentLengthHeader ? Number.parseInt(contentLengthHeader, 10) : null;\n  if (contentLength !== null && Number.isFinite(contentLength) && contentLength > maxBytes) {\n    throw new Error(`Remote image exceeds ${maxBytes} byte limit`);\n  }\n\n  if (!response.body) {\n    const buffer = Buffer.from(await response.arrayBuffer());\n    if (buffer.byteLength > maxBytes) {\n      throw new Error(`Remote image exceeds ${maxBytes} byte limit`);\n    }\n    return buffer;\n  }\n\n  const reader = response.body.getReader();\n  const chunks: Buffer[] = [];\n  let totalBytes = 0;\n\n  try {\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) break;","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/remoteImageFetch.ts#L129-L165","documentation":"Error \"Remote image exceeds ${maxBytes} byte limit\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/network/remoteImageFetch.ts:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}