Skip to content

fix: rpc fallback needs to check both exception and nested error - #573

Open
L03TJ3 wants to merge 1 commit into
masterfrom
fix-rpc-fallback
Open

fix: rpc fallback needs to check both exception and nested error#573
L03TJ3 wants to merge 1 commit into
masterfrom
fix-rpc-fallback

Conversation

@L03TJ3

@L03TJ3 L03TJ3 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Noticed on dev server. if the exception of RPC is root exception and not in exception.error the fallback does not catch it properly and stops cycling through other RPC providers in the list.

Summary by Sourcery

Bug Fixes:

  • Ensure connection errors are detected from either the nested error field or the root exception so failing providers do not block fallback to other RPC endpoints.

@L03TJ3
L03TJ3 requested a review from sirpy August 10, 2026 07:26

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • When falling back to exception in isConnectionError(error || exception), consider using a nullish-coalescing check (e.g., error ?? exception) and guarding for non-object/non-Error values so that truthy but non-informative error values (like an empty string or boolean) don't mask a more useful exception message.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When falling back to `exception` in `isConnectionError(error || exception)`, consider using a nullish-coalescing check (e.g., `error ?? exception`) and guarding for non-object/non-Error values so that truthy but non-informative `error` values (like an empty string or boolean) don't mask a more useful exception message.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant