fix(portal): actionable error when a dataset lacks a requested table#171
Open
abernatskiy wants to merge 1 commit into
Open
fix(portal): actionable error when a dataset lacks a requested table#171abernatskiy wants to merge 1 commit into
abernatskiy wants to merge 1 commit into
Conversation
A trace/transfer source on a dataset with no `traces` table — a network that omits call traces entirely (e.g. celo), or one that only serves them above a cutoff block (e.g. optimism below the Bedrock block) — surfaced the raw Portal 400 `couldn't parse request: table 'traces' does not exist`, with no hint about the cause or the fix. The missing-COLUMN path already degrades/fails loud with a precise message; the missing-TABLE case fell through to a generic PortalHttpError. Map the "table '<t>' does not exist" 400 to a typed PortalMissingTableError and reword it in the stream loop (mirroring the PortalQueryTooLargeError lever) into a message that names the chain, the unavailable source, and the remedy — remove the trace sources for this chain, or index a network/range that provides them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011h8zdhxsC8A2bcFqZRcjeB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tracestable — a network that omits call traces entirely (e.g. celo), or one that only serves them above a cutoff block (e.g. optimism below the Bedrock block) — surfaced the raw Portal 400couldn't parse request: table 'traces' does not exist, with no hint about the cause or the fix.parseSchemaFieldError); the missing-table case fell through to a genericPortalHttpError. This adds a typedPortalMissingTableErrorand rewords it in the stream loop (mirroring thePortalQueryTooLargeErrorlever) into a message naming the chain, the unavailable source, and the remedy.PortalThrottleExhaustedError, Portal throttle (429) on a full backfill against the free public Portal exhausts retries and crashes via unhandledRejection — should degrade/backoff or fail with an actionable error #116) — it does not change async error propagation.Example before → after (optimism call traces below Bedrock):
Coverage (Portal layer)
New code fully covered (specific
tracesmessage + generic fallback); overall coverage unchanged.Test plan
scripts/sync-upstream.sh 0.16.9 --coveragegreen — 330 passed (18 files); adds 2 tests inportal-client.test.ts(specifictracesmessage + generic fallback)biome check .cleantable '<t>' does not exist400 maps toPortalMissingTableErrorand reworsds into an actionable, source-named message; a table with no specific entry falls back to a generic named message; an unrelated 400 still surfaces asPortalHttpError(unchanged).🤖 Generated with Claude Code