From 8432cca3ea7ac5d2737a2207a3f6435bbfa59319 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 14 Jun 2021 15:22:16 +0200 Subject: [PATCH] show (caught) exceptions during import now as error for easier spotting console.error instead of console.log --- api/js/jsapi/egw.js | 6 +++--- api/js/jsapi/egw_files.js | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/js/jsapi/egw.js b/api/js/jsapi/egw.js index 4dabdea8f6..7fa1f8be3c 100644 --- a/api/js/jsapi/egw.js +++ b/api/js/jsapi/egw.js @@ -202,7 +202,7 @@ window.app = {classes: {}}; document.head.appendChild(script); }) // catch and display, but not stop execution - .catch((err) => { console.log(src+":\n\n"+err.message)}); + .catch((err) => { console.error(src+": "+err.message)}); })); } @@ -215,10 +215,10 @@ window.app = {classes: {}}; window.egw_LAB = window.egw_ready = legacy_js_import(include.filter((src) => src.match(legacy_js_regexp) !== null), window.egw_webserverUrl) .then(Promise.all(egw_modules.map(mod => import(window.egw_webserverUrl+'/api/js/jsapi/'+mod+'.js') - .catch((err) => {console.log(rel_src+":\n\n"+err.message)})))) + .catch((err) => {console.error(rel_src+": "+err.message)})))) .then(() => Promise.all(include.filter((src) => src.match(legacy_js_regexp) === null) //.reverse() .map(rel_src => import(window.egw_webserverUrl+'/'+rel_src) - .catch((err) => {console.log(rel_src+":\n\n"+err.message)}) + .catch((err) => {console.error(rel_src+": "+err.message)}) ))).then(() => { // We need to override the globalEval to mitigate potential execution of diff --git a/api/js/jsapi/egw_files.js b/api/js/jsapi/egw_files.js index 0c617125dc..d8d824ea5c 100644 --- a/api/js/jsapi/egw_files.js +++ b/api/js/jsapi/egw_files.js @@ -7,7 +7,6 @@ * @link http://www.egroupware.org * @author Andreas Stöckel (as AT stylite.de) * @author Ralf Becker - * @version $Id$ */ /*egw:uses @@ -164,7 +163,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd) const src = _jsFiles[0]; promise = import(_prefix ? _prefix+src : src) .catch((err) => { - console.log(src+":\n\n"+err.message); + console.error(src+": "+err.message); }); } else @@ -172,7 +171,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd) promise = Promise.all(_jsFiles.map((src) => { import(_prefix ? _prefix+src : src) .catch((err) => { - console.log(src+":\n\n"+err.message); + console.error(src+": "+err.message); }) })); }