Skip to content

Commit

Permalink
Catch errors during attestation routine to avoid unhandled promise re…
Browse files Browse the repository at this point in the history
…jections
  • Loading branch information
nflaig committed Mar 23, 2023
1 parent 6778f6b commit 9ab6aad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/validator/src/services/attestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export class AttestationService {
const dutiesByCommitteeIndex = groupAttDutiesByCommitteeIndex(duties);
await Promise.all(
Array.from(dutiesByCommitteeIndex.entries()).map(([index, duties]) =>
this.runAttestationTasksPerCommittee(duties, slot, index, signal)
this.runAttestationTasksPerCommittee(duties, slot, index, signal).catch((e) => {
this.logger.error("Error on attestation routine", {slot, index}, e);
})
)
);
} else {
Expand Down

0 comments on commit 9ab6aad

Please sign in to comment.