{"record":{"id":"2cd93e818a8db664","repo":"unionlabs/union","slug":"http-res-status-res-statustext","errorCode":null,"errorMessage":"HTTP ${res.status} - ${res.statusText}","messagePattern":"HTTP (.+?) - (.+?)","errorType":"exception","errorClass":"RpcStatusError","httpStatus":null,"severity":"warning","filePath":"app2/src/routes/nodes/+page.svelte","lineNumber":78,"sourceCode":"  url: string,\n): Effect.Effect<RpcStatusResult, RpcStatusError> =>\n  Effect.tryPromise({\n    try: async signal => {\n      if (type === \"cosmos\") {\n        const { result: res, duration } = await withTiming(async () =>\n          fetch(url, {\n            method: \"POST\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify({\n              jsonrpc: \"2.0\",\n              id: 1,\n              method: \"status\",\n              params: [],\n            }),\n          })\n        )\n        if (!res.ok) {\n          throw new RpcStatusError(\"cosmos\", url, `HTTP ${res.status} - ${res.statusText}`)\n        }\n        const data = await res.json()\n        if (!(data?.result?.sync_info && data?.result?.node_info)) {\n          throw new RpcStatusError(\"cosmos\", url, \"Malformed response\", data)\n        }\n        return {\n          url,\n          type: \"cosmos\",\n          responseTimeMs: duration,\n          status: {\n            kind: \"cosmos\",\n            latestBlockHeight: Number(data.result.sync_info.latest_block_height),\n            catchingUp: data.result.sync_info.catching_up,\n            moniker: data.result.node_info.moniker,\n            network: data.result.node_info.network,\n          },\n        }\n      }","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/app2/src/routes/nodes/+page.svelte#L60-L96","documentation":"RpcStatusError raised by the nodes status page when probing a Cosmos RPC: it POSTs a JSON-RPC \"status\" request and the HTTP response is not ok (res.ok false). The message embeds the HTTP status code and status text from the node or gateway that answered.","triggerScenarios":"A Cosmos/CometBFT RPC URL returning 4xx/5xx: 404 (wrong path, endpoint is not a Tendermint RPC), 405 (GET-only route), 401/403 (auth-protected or geo-blocked node), 429 (rate limit), 502/503 (gateway or node down).","commonSituations":"Pasting a REST (1317) or gRPC (9090) port URL instead of the RPC (26657) port; public RPC endpoints that rate-limit bursts of probes; CORS/proxy front-ends returning HTML error pages with non-200 codes.","solutions":["Confirm the URL targets the CometBFT/Tendermint RPC endpoint (default port 26657) and answers POST / with a JSON-RPC body","Open the URL in a browser/curl to see the exact status code and adjust (auth token, correct path, different provider)","Reduce probe frequency or use a paid/private RPC to avoid 429s"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const isCometBftRpcCandidate = (url: string) => /^https?:\\/\\//.test(url) && !url.includes(\"26657\") === false // explicit port check helps\n// cheaper: validate reachability before adding to the list\nawait fetch(url, { method: \"HEAD\" }).catch(() => { /* mark endpoint suspicious before probing */ })","typeGuard":null,"tryCatchPattern":"// The page already maps probes to RpcStatusError rows; wrap per-endpoint:\ntry {\n  status = await checkCosmos(url)\n} catch (error) {\n  if (error instanceof RpcStatusError) {\n    // render HTTP status in the node table; mark endpoint offline on 5xx, auth-issue on 401/403\n  }\n  throw error\n}","preventionTips":["Only list CometBFT RPC endpoints (port 26657 or provider equivalents) for cosmos probes","Prefer endpoints with generous CORS and rate limits for browser probing","Treat 429/5xx as transient (retry later) and 401/403/404 as configuration errors"],"tags":["cosmos","rpc","http","network","ui"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}