feat: Update error handling to use getErrorMessage utility and improve logging across multiple services
This commit is contained in:
5
mod.ts
5
mod.ts
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user