Skip to content

Commit

Permalink
Use try-catch pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed May 22, 2023
1 parent 1415f85 commit 484947c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/validator/src/services/attestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ export class AttestationService {
} else {
// Beacon node's endpoint produceAttestationData return data is not dependant on committeeIndex.
// Produce a single attestation for all committees and submit unaggregated attestations in one go.
await this.runAttestationTasksGrouped(duties, slot, signal).catch((e) => {
this.logger.error("Error on attestation routine", {slot}, e);
});
try {
await this.runAttestationTasksGrouped(duties, slot, signal);
} catch (e) {
this.logger.error("Error on attestation routine", {slot}, e as Error);
}
}
};

Expand Down

0 comments on commit 484947c

Please sign in to comment.