MCPcopy Create free account
hub / github.com/pollinations/pollinations / remapUpstreamStatus

Function remapUpstreamStatus

shared/error.ts:324–328  ·  view source on GitHub ↗
(status: number)

Source from the content-addressed store, hash-verified

322 * (400/413/422) as-is since those can reflect user input we failed to validate.
323 */
324export function remapUpstreamStatus(status: number): ContentfulStatusCode {
325 const remapTo502 = new Set([401, 403, 404, 409, 415, 429]);
326 if (remapTo502.has(status)) return 502;
327 return status as ContentfulStatusCode;
328}
329
330export function getErrorCode(status: number): string {
331 const codes: Record<number, string> = {

Callers 5

classifyImageHttpErrorFunction · 0.90
throw3dErrorFunction · 0.90
createApiErrorFunction · 0.90
generateTextResponseFunction · 0.90
ensureUpstreamOkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected