Skip to content

Commit

Permalink
Catch errors thrown by runAttestationTasksPerCommittee to avoid unhan…
Browse files Browse the repository at this point in the history
…dled promise rejections
  • Loading branch information
nflaig committed Mar 22, 2023
1 parent 69827ad commit ebf265d
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 running attestation tasks", {slot, index}, e);
})
)
);
} else {
Expand Down

0 comments on commit ebf265d

Please sign in to comment.