Skip to content

Commit

Permalink
Add sequence number
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Oct 12, 2023
1 parent 906f739 commit edb955a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ async function manageMessage(
async onFailedAttempt(error) {
events.dispatchEvent(
new CustomEvent("failed-attempt", {
detail: { type, target, error, attemptCount: error.attemptNumber },
detail: {
type,
seq,
target,
error,
attemptCount: error.attemptNumber,
},
})
);

Expand Down Expand Up @@ -156,7 +162,9 @@ async function manageMessage(
}

events.dispatchEvent(
new CustomEvent("attempts-exhausted", { detail: { type, target, error } })
new CustomEvent("attempts-exhausted", {
detail: { type, seq, target, error },
})
);

throw error;
Expand Down

0 comments on commit edb955a

Please sign in to comment.