Skip to content

Commit b6f14ac

Browse files
committed
fix: properly detect the span error status
1 parent 9f25613 commit b6f14ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/nextjs/src/server/vercelCronsMonitoring.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export function maybeCompleteCronCheckIn(span: Span): void {
9292

9393
const duration = _INTERNAL_safeDateNow() / 1000 - startTime;
9494
const spanStatus = spanToJSON(span).status;
95-
const checkInStatus = spanStatus === 'error' ? 'error' : 'ok';
95+
// Span status is 'ok' for success, undefined for unset, or an error message like 'internal_error'
96+
const checkInStatus = spanStatus && spanStatus !== 'ok' ? 'error' : 'ok';
9697

9798
captureCheckIn({
9899
checkInId: checkInId as string,

0 commit comments

Comments
 (0)