- offer to create tag when none is found while adding a link from cli - fix tag display in search
14 lines
344 B
JavaScript
14 lines
344 B
JavaScript
export const handleExitError = (err, type = "Unhandled error") => {
|
|
const isExit =
|
|
err?.name === "ExitPromptError" ||
|
|
err?.code === "ERR_CANCELED" ||
|
|
err?.message?.includes("SIGINT");
|
|
|
|
if (isExit) {
|
|
console.log("\n👋 Exiting. Cya!\n");
|
|
process.exit(0);
|
|
}
|
|
|
|
console.error(`❌ ${type}:`, err);
|
|
process.exit(1);
|
|
};
|