Skip to content

Commit 14eda60

Browse files
committed
Log warnings for stop-time artifact collection
1 parent a96cf79 commit 14eda60

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

apps/api/src/routes/sandboxes.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,19 @@ const collectArtifactsOnStop = (
333333
paths,
334334
})
335335

336+
if (collected.length === 0) {
337+
yield* Effect.logWarning(
338+
`Stop-time artifact collection returned zero artifacts for sandbox ${sandboxId} with ${paths.length} registered path(s): ${paths.join(', ')}`,
339+
)
340+
return
341+
}
342+
343+
if (collected.length < paths.length) {
344+
yield* Effect.logWarning(
345+
`Stop-time artifact collection returned ${collected.length}/${paths.length} artifacts for sandbox ${sandboxId}`,
346+
)
347+
}
348+
336349
for (const artifact of collected) {
337350
const artifactId = generateUUIDv7()
338351
yield* artifactRepo.create({
@@ -347,7 +360,11 @@ const collectArtifactsOnStop = (
347360
})
348361
}
349362
}).pipe(
350-
Effect.catchAll(() => Effect.void),
363+
Effect.catchAll((error) =>
364+
Effect.logWarning(
365+
`Stop-time artifact collection failed for sandbox ${sandboxId}: ${String(error)}`,
366+
),
367+
),
351368
)
352369

353370
const stopSandbox = Effect.gen(function* () {

0 commit comments

Comments
 (0)