Skip to content

[SDK] Handle subgraph errors properly #3782

Open
flopez7 wants to merge 3 commits intodevelopfrom
feat/sdk/subgraph-errors
Open

[SDK] Handle subgraph errors properly #3782
flopez7 wants to merge 3 commits intodevelopfrom
feat/sdk/subgraph-errors

Conversation

@flopez7
Copy link
Contributor

@flopez7 flopez7 commented Feb 11, 2026

Issue tracking

Close #3745

Context behind the change

  • Added typed subgraph errors in TS (SubgraphRequestError, SubgraphBadIndexerError)
  • Updated exception filters to avoid logging bad indexers as “Unhandled exception”
  • Other subgraph failures are still logged, but under a dedicated subgraph error path

How has this been tested?

Ran unit tests

Release plan

  • Deploy new SDK version.
  • Add new monitor+alert on DataDog based on new logs

Potential risks; What to monitor; Rollback plan

None

…update exception filters to handle subgraph errors
@flopez7 flopez7 requested review from dnechay and portuu3 February 11, 2026 14:37
@flopez7 flopez7 self-assigned this Feb 11, 2026
@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

5 Skipped Deployments
Project Deployment Actions Updated (UTC)
faucet-frontend Ignored Ignored Preview Feb 16, 2026 3:20pm
faucet-server Ignored Ignored Preview Feb 16, 2026 3:20pm
human-app Skipped Skipped Feb 16, 2026 3:20pm
human-dashboard-frontend Skipped Skipped Feb 16, 2026 3:20pm
staking-dashboard Skipped Skipped Feb 16, 2026 3:20pm

Request Review

Copy link
Collaborator

@dnechay dnechay left a comment

Choose a reason for hiding this comment

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

LGTM overall, one suggestion

Also please add to release plan that we need to add new monitor+alert on DataDog based on new logs

Comment on lines 34 to 44
if (exception instanceof SubgraphBadIndexerError) {
this.logger.warn('Subgraph bad indexers', {
error: exception,
path: request.url,
});
} else {
this.logger.error('Subgraph request failed', {
error: exception,
path: request.url,
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (exception instanceof SubgraphBadIndexerError) {
this.logger.warn('Subgraph bad indexers', {
error: exception,
path: request.url,
});
} else {
this.logger.error('Subgraph request failed', {
error: exception,
path: request.url,
});
}
this.logger.error('Unhandled subgraph error', {
error: exception,
path: request.url,
});

If it's necessary - in DataDog it will be possible to filter errors based on the error.name (aka exception.name) so we will be able to distinguish between them and set up different alerts if needed

@vercel vercel bot temporarily deployed to Preview – staking-dashboard February 16, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend February 16, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – human-app February 16, 2026 15:20 Inactive
@flopez7 flopez7 requested a review from dnechay February 16, 2026 15:21
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.

Exclude noisy subgraph errors from being logged as part of "unhandled exception" logging

2 participants