From 4dc8be497c26954ca08fe395d181b885de955e3f Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Tue, 7 May 2024 14:32:27 +0800 Subject: [PATCH] Display error message without a code --- scripts/logging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/logging.js b/scripts/logging.js index 57a7ccb..2be9dc3 100644 --- a/scripts/logging.js +++ b/scripts/logging.js @@ -79,7 +79,7 @@ export default class logging { ) : false; // Display the error message. - console.error('%c%s%c%s%c%s%c\n%s%c', `font-weight: bold;`, ERROR_CODE, ``, `: `, ``, ERROR_MESSAGE, `font-family: monospace;`, ERROR_STACK, ``); + (ERROR_CODE && ERROR_MESSAGE && ERROR_STACK) ? console.error(`${ERROR_CODE}: ${ERROR_MESSAGE}\n${ERROR_STACK}`) : console.error(ERROR_MESSAGE); try { (critical) ? alert(texts.localized(`error_msg_GUI`, false, [String(ERROR_CODE), ERROR_MESSAGE])) : M.toast({ text: ERROR_MESSAGE });