/admin/plugins: Fix logging of error messages

pull/4747/head
Richard Hansen 2021-02-08 16:21:50 -05:00 committed by John McLear
parent 94a65062c7
commit 83a519941b
1 changed files with 9 additions and 9 deletions

View File

@ -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});
});
});
});