Enhance error handling and logging in early-settings and worker-utils

- Added silent debugging for settings file loading failures in early-settings.ts.
- Improved error logging in worker-utils.ts for health check and worker startup failures, including detailed error information and context.
This commit is contained in:
Alex Newman
2025-12-09 14:04:32 -05:00
parent a2f7a4dc5a
commit 7cab32151e
11 changed files with 193 additions and 162 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import { join } from 'path';
import { homedir } from 'os';
import { existsSync, readFileSync } from 'fs';
import { silentDebug } from '../utils/silent-debug.js';
const SETTINGS_PATH = join(homedir(), '.claude-mem', 'settings.json');
@@ -23,8 +24,8 @@ export function loadEarlySetting(key: keyof EarlySettings, defaultValue: string)
const fileValue = data.env?.[key];
if (fileValue !== undefined) return fileValue;
}
} catch {
// Fail silently - fall through to env var
} catch (error) {
silentDebug('Failed to load settings file', { error, settingsPath: SETTINGS_PATH, key });
}
return process.env[key] || defaultValue;