From 946c7fe3370ef510f850162a435cf71bc60b19fb Mon Sep 17 00:00:00 2001 From: Christian Weimann Date: Tue, 15 Aug 2023 07:14:35 +0200 Subject: [PATCH] Improve logging --- utils/lib.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utils/lib.js b/utils/lib.js index 969bb95..d1cd070 100644 --- a/utils/lib.js +++ b/utils/lib.js @@ -27,6 +27,9 @@ function compare(a, b, operator) { case '>=': returnValue = a.greaterThanOrEqual(b); break; + default: + console.error(`${operator} is no valid operator`); + return; } } catch(e) { logMsg = `Standard comparison of ${a}, ${b} with operator ${operator}`; @@ -52,12 +55,7 @@ function compare(a, b, operator) { } } - if (returnValue == undefined) { - console.error(`${operator} is no valid operator`); - } else { - console.debug(logMsg); - } - + console.debug(logMsg); return returnValue; }