Skip to content

Commit c89de4e

Browse files
committed
fix(infra): log errors from restart sentinel cleanup instead of silent catch
The empty catch blocks in clearRestartSentinel() and removeLegacyRestartSentinel() silently swallowed DB write and file-deletion failures, leaving stale sentinel artifacts that could trigger spurious recovery flows on next restart.
1 parent 3d20614 commit c89de4e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/infra/restart-sentinel.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ export async function clearRestartSentinel(env: NodeJS.ProcessEnv = process.env)
224224
},
225225
{ env },
226226
);
227-
} catch {}
227+
} catch (err) {
228+
console.error("[openclaw] Failed to clear restart sentinel:", err);
229+
}
228230
await removeLegacyRestartSentinel(env);
229231
}
230232

@@ -235,7 +237,9 @@ function resolveLegacyRestartSentinelPath(env: NodeJS.ProcessEnv): string {
235237
async function removeLegacyRestartSentinel(env: NodeJS.ProcessEnv): Promise<void> {
236238
try {
237239
await rm(resolveLegacyRestartSentinelPath(env), { force: true });
238-
} catch {}
240+
} catch (err) {
241+
console.error("[openclaw] Failed to remove legacy restart sentinel:", err);
242+
}
239243
}
240244

241245
async function importLegacyRestartSentinel(

0 commit comments

Comments
 (0)