Skip to content

Commit

Permalink
fix: ignore noisy eventstream errors due to DNS resolution errors (#6972
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nflaig authored Jul 23, 2024
1 parent 02cc65b commit 81f9d97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api/src/beacon/client/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getClient(config: ChainForkConfig, baseUrl: string): ApiClient {
const errEs = err as unknown as EventSourceError;

// Ignore noisy errors due to beacon node being offline
if (!errEs.message?.includes("ECONNREFUSED")) {
if (!/ECONNREFUSED|EAI_AGAIN/.test(errEs.message ?? "")) {
// If there is no message it likely indicates that the server closed the connection
onError?.(new Error(errEs.message ?? "Server closed connection"));
}
Expand Down

0 comments on commit 81f9d97

Please sign in to comment.