feat: Update error handling to use getErrorMessage utility and improve logging across multiple services

This commit is contained in:
2025-11-25 08:25:54 +00:00
parent c59d56e70a
commit e94906b3bf
13 changed files with 97 additions and 75 deletions

5
mod.ts
View File

@@ -7,13 +7,14 @@
*/
import { runCli } from './ts/index.ts';
import { getErrorMessage } from './ts/utils/error.ts';
if (import.meta.main) {
try {
await runCli();
} catch (error) {
console.error(`Error: ${error.message}`);
if (Deno.args.includes('--debug')) {
console.error(`Error: ${getErrorMessage(error)}`);
if (Deno.args.includes('--debug') && error instanceof Error) {
console.error(error.stack);
}
Deno.exit(1);