Skip to content

Commit 2f973a6

Browse files
committed
Use a tryCatch just to be absolutely sure
1 parent 3b63ac0 commit 2f973a6

File tree

1 file changed

+10
-1
lines changed
  • internal-packages/schedule-engine/src/engine

1 file changed

+10
-1
lines changed

internal-packages/schedule-engine/src/engine/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ export class ScheduleEngine {
123123
const startTime = Date.now();
124124

125125
if (this.options.onRegisterScheduleInstance) {
126-
await this.options.onRegisterScheduleInstance(params.instanceId);
126+
const [registerError] = await tryCatch(
127+
this.options.onRegisterScheduleInstance(params.instanceId)
128+
);
129+
130+
if (registerError) {
131+
this.logger.error("Error calling the onRegisterScheduleInstance callback", {
132+
instanceId: params.instanceId,
133+
error: registerError,
134+
});
135+
}
127136
}
128137

129138
span.setAttribute("instanceId", params.instanceId);

0 commit comments

Comments
 (0)