@@ -215,7 +215,11 @@ async function writeConfigHealthState(
215215 encoding : "utf-8" ,
216216 mode : 0o600 ,
217217 } ) ;
218- } catch { }
218+ } catch ( err ) {
219+ deps . logger . warn (
220+ `Failed to write config health state: ${ err instanceof Error ? err . message : String ( err ) } ` ,
221+ ) ;
222+ }
219223}
220224
221225function writeConfigHealthStateSync ( deps : ObserveRecoveryDeps , state : ConfigHealthState ) : void {
@@ -226,7 +230,11 @@ function writeConfigHealthStateSync(deps: ObserveRecoveryDeps, state: ConfigHeal
226230 encoding : "utf-8" ,
227231 mode : 0o600 ,
228232 } ) ;
229- } catch { }
233+ } catch ( err ) {
234+ deps . logger . warn (
235+ `Failed to write config health state: ${ err instanceof Error ? err . message : String ( err ) } ` ,
236+ ) ;
237+ }
230238}
231239
232240function getConfigHealthEntry ( state : ConfigHealthState , configPath : string ) : ConfigHealthEntry {
@@ -365,7 +373,10 @@ async function persistClobberedConfigSnapshot(params: {
365373 flag : "wx" ,
366374 } ) ;
367375 return targetPath ;
368- } catch {
376+ } catch ( err ) {
377+ params . deps . logger . warn (
378+ `Failed to persist clobbered config snapshot: ${ err instanceof Error ? err . message : String ( err ) } ` ,
379+ ) ;
369380 return null ;
370381 }
371382}
@@ -384,7 +395,10 @@ function persistClobberedConfigSnapshotSync(params: {
384395 flag : "wx" ,
385396 } ) ;
386397 return targetPath ;
387- } catch {
398+ } catch ( err ) {
399+ params . deps . logger . warn (
400+ `Failed to persist clobbered config snapshot: ${ err instanceof Error ? err . message : String ( err ) } ` ,
401+ ) ;
388402 return null ;
389403 }
390404}
@@ -457,10 +471,16 @@ export async function maybeRecoverSuspiciousConfigRead(params: {
457471 try {
458472 await params . deps . fs . promises . copyFile ( backupPath , params . configPath ) ;
459473 restoredFromBackup = true ;
460- } catch { }
474+ } catch ( err ) {
475+ params . deps . logger . warn (
476+ `Failed to restore config from backup: ${ err instanceof Error ? err . message : String ( err ) } ` ,
477+ ) ;
478+ }
461479
462480 params . deps . logger . warn (
463- `Config auto-restored from backup: ${ params . configPath } (${ suspicious . join ( ", " ) } )` ,
481+ restoredFromBackup
482+ ? `Config auto-restored from backup: ${ params . configPath } (${ suspicious . join ( ", " ) } )`
483+ : `Config backup restore failed: ${ params . configPath } (${ suspicious . join ( ", " ) } )` ,
464484 ) ;
465485 await appendConfigAuditRecord ( {
466486 fs : params . deps . fs ,
@@ -594,10 +614,16 @@ export function maybeRecoverSuspiciousConfigReadSync(params: {
594614 try {
595615 params . deps . fs . copyFileSync ( backupPath , params . configPath ) ;
596616 restoredFromBackup = true ;
597- } catch { }
617+ } catch ( err ) {
618+ params . deps . logger . warn (
619+ `Failed to restore config from backup: ${ err instanceof Error ? err . message : String ( err ) } ` ,
620+ ) ;
621+ }
598622
599623 params . deps . logger . warn (
600- `Config auto-restored from backup: ${ params . configPath } (${ suspicious . join ( ", " ) } )` ,
624+ restoredFromBackup
625+ ? `Config auto-restored from backup: ${ params . configPath } (${ suspicious . join ( ", " ) } )`
626+ : `Config backup restore failed: ${ params . configPath } (${ suspicious . join ( ", " ) } )` ,
601627 ) ;
602628 appendConfigAuditRecordSync ( {
603629 fs : params . deps . fs ,
0 commit comments