fix: improve type safety and add error logging (#378)

- Replace 'as any' with proper type definition for error status code access
- Add error logging to sendPresenceUpdate() catch block
- Add debug logging when .env file is not found

These changes improve type safety and visibility into potential failures
without changing any core functionality.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: gavrielc <gabicohen22@yahoo.com>
This commit is contained in:
Chujiang
2026-02-23 06:11:52 +08:00
committed by GitHub
parent 856f98023c
commit 9fb1790e12
2 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import fs from 'fs';
import path from 'path';
import { logger } from './logger.js';
/**
* Parse the .env file and return values for the requested keys.
@@ -12,7 +13,8 @@ export function readEnvFile(keys: string[]): Record<string, string> {
let content: string;
try {
content = fs.readFileSync(envFile, 'utf-8');
} catch {
} catch (err) {
logger.debug({ err }, '.env file not found, using defaults');
return {};
}