From 83a519941b991037a0c1ddb1d92b9f463239a668 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 8 Feb 2021 16:21:50 -0500 Subject: [PATCH] /admin/plugins: Fix logging of error messages --- src/node/hooks/express/adminplugins.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/node/hooks/express/adminplugins.js b/src/node/hooks/express/adminplugins.js index 5963fb208..7c0db0973 100644 --- a/src/node/hooks/express/adminplugins.js +++ b/src/node/hooks/express/adminplugins.js @@ -65,8 +65,8 @@ exports.socketio = (hookName, args, cb) => { }); socket.emit('results:updatable', {updatable}); - } catch (er) { - console.warn(er); + } catch (err) { + console.warn(err.stack || err.toString()); socket.emit('results:updatable', {updatable: {}}); } @@ -99,22 +99,22 @@ exports.socketio = (hookName, args, cb) => { }); socket.on('install', (pluginName) => { - installer.install(pluginName, (er) => { - if (er) console.warn(er); + installer.install(pluginName, (err) => { + if (err) console.warn(err.stack || err.toString()); socket.emit('finished:install', { plugin: pluginName, - code: er ? er.code : null, - error: er ? er.message : null, + code: err ? err.code : null, + error: err ? err.message : null, }); }); }); socket.on('uninstall', (pluginName) => { - installer.uninstall(pluginName, (er) => { - if (er) console.warn(er); + installer.uninstall(pluginName, (err) => { + if (err) console.warn(err.stack || err.toString()); - socket.emit('finished:uninstall', {plugin: pluginName, error: er ? er.message : null}); + socket.emit('finished:uninstall', {plugin: pluginName, error: err ? err.message : null}); }); }); });