Skip to content

Commit

Permalink
fix: use promise.then
Browse files Browse the repository at this point in the history
  • Loading branch information
lacolaco committed Sep 24, 2023
1 parent 17c9c6a commit 86b620f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ export default {
const checkInId = sentry.captureCheckIn({ monitorSlug: 'scheduled', status: 'in_progress' });
ctx.waitUntil(
execute(env, sentry)
.then(() => {
sentry.captureCheckIn({ checkInId, monitorSlug: 'scheduled', status: 'ok' });
})
.catch((e) => {
console.error(e);
sentry.captureException(e);
sentry.captureCheckIn({ checkInId, monitorSlug: 'scheduled', status: 'error' });
throw e;
})
.finally(() => {
sentry.captureCheckIn({ checkInId, monitorSlug: 'scheduled', status: 'ok' });
}),
);
},
Expand Down

0 comments on commit 86b620f

Please sign in to comment.