{"record":{"id":"2d8c6147199af7f9","repo":"unionlabs/union","slug":"missing-result-field","errorCode":null,"errorMessage":"Missing result field","messagePattern":"Missing result field","errorType":"exception","errorClass":"RpcStatusError","httpStatus":null,"severity":"warning","filePath":"app2/src/routes/nodes/+page.svelte","lineNumber":115,"sourceCode":"      if (type === \"evm\") {\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: \"eth_blockNumber\",\n              params: [],\n            }),\n          })\n        )\n        if (!res.ok) {\n          throw new RpcStatusError(\"evm\", url, `HTTP ${res.status} - ${res.statusText}`)\n        }\n        const data = await res.json()\n        if (!data?.result) {\n          throw new RpcStatusError(\"evm\", url, \"Missing result field\", data)\n        }\n        const hex = data.result as string\n        return {\n          url,\n          type: \"evm\",\n          responseTimeMs: duration,\n          status: {\n            kind: \"evm\",\n            latestBlockHex: hex,\n            latestBlockNumber: Number.parseInt(hex, 16),\n          },\n        }\n      }\n      throw new RpcStatusError(type, url, `Unsupported type: ${type}`)\n    },\n    catch: err =>\n      err instanceof RpcStatusError ? err : new RpcStatusError(type, url, \"Unknown error\", err),\n  })","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/app2/src/routes/nodes/+page.svelte#L97-L133","documentation":"RpcStatusError thrown after an HTTP 200 response to the eth_blockNumber probe: the parsed JSON has no truthy data.result. JSON-RPC over HTTP frequently returns 200 with an error object instead of a result, so this guard catches RPC-level failures the HTTP status cannot see; the payload is attached.","triggerScenarios":"Provider returns {jsonrpc:\"2.0\", id:1, error:{code:-32000...}} with HTTP 200: invalid API key, method not enabled, rate limit exceeded, or daily quota exhausted. Also a proxy returning {\"ok\":false}-style JSON.","commonSituations":"Free-tier API keys hitting daily caps; keys without the needed network enabled; endpoints that disable eth_blockNumber; corporate proxies rewriting responses.","solutions":["Inspect the attached data.error field — it names the exact RPC failure (auth, quota, method)","Fix the API key / plan / allowed methods on the provider and re-probe","Use an endpoint that serves eth_blockNumber without restrictions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const data = await res.json()\nif (!data?.result) {\n  const rpcError = (data as { error?: { message?: string } }).error\n  // classify: rate limit / auth / method disabled — show rpcError?.message\n}","typeGuard":"const isEvmBlockNumberPayload = (d: unknown): d is { result: string } =>\n  typeof d === \"object\" && d !== null && typeof (d as { result?: unknown }).result === \"string\"","tryCatchPattern":"try {\n  status = await checkEvm(url)\n} catch (error) {\n  if (error instanceof RpcStatusError && error.message === \"Missing result field\") {\n    // error.data.error.message names the cause (quota/auth); mark endpoint accordingly\n  }\n  throw error\n}","preventionTips":["Remember JSON-RPC failures arrive as HTTP 200 — always check data.result and data.error","Monitor API key quotas and method allowlists on providers","Attach the raw payload to errors so classification is possible downstream"],"tags":["evm","rpc","json-rpc","validation"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}