From 887eb857649bf903e2f8746495a0bfec0ff2925f Mon Sep 17 00:00:00 2001 From: Julia Logan Date: Tue, 2 Jul 2024 01:30:23 +0200 Subject: [PATCH] best error handling --- src/errorHandling.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/errorHandling.js diff --git a/src/errorHandling.js b/src/errorHandling.js new file mode 100644 index 0000000..6a6aeb7 --- /dev/null +++ b/src/errorHandling.js @@ -0,0 +1,7 @@ +function errorHandling(error, origin) { + console.error({ error, origin }); + console.error("OOPS! An error occoured. Please create an issue on the git repo."); + process.exitCode = 1; +} + +export default errorHandling;