From 5eef3369b71012629cb4fd20dd948bf3bc0a22e1 Mon Sep 17 00:00:00 2001 From: bn-l Date: Thu, 4 Apr 2024 22:23:22 +1100 Subject: [PATCH] unhandled handling --- source/index.mts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/index.mts b/source/index.mts index da8820f..ef28fba 100644 --- a/source/index.mts +++ b/source/index.mts @@ -10,11 +10,22 @@ import ora, { Ora } from "ora"; import pathe from "pathe"; import wrapAnsi from "wrap-ansi"; + +process.on("unhandledRejection", (error) => { + if (error instanceof Error) { + console.error(`\nError: ${ error.message }\n\nIf this is a bug, report here: https://github.com/bn-l/GithubExtractorCLI/issues\n`); + } + else { + console.error(`\nError: ${ error }\n\nIf this is a bug, report here: https://github.com/bn-l/GithubExtractorCLI/issues\n`); + } +}); + // ? Note: // - The cli's help text is the main documentation. All changes should begin there and then be // copied to the README. // Todo: +// - option to skip initial dir scan // - list with or without owner/repo prefix // - Quick SVG based video. // - Longer playable .cast for website.