diff --git a/lib/plugins.js b/lib/plugins.js index 646d2951..8cf21770 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -83,9 +83,14 @@ function loadPlugin (name, config) { // each used plugin MUST be installed try { plugin = require('lamassu-' + name) - } catch (_) { - throw new Error(name + ' module is not installed. ' + - 'Try running \'npm install --save lamassu-' + name + '\' first') + } catch (err) { + if (err.code === 'MODULE_NOT_FOUND') { + throw new Error(name + ' module is not installed. ' + + 'Try running \'npm install --save lamassu-' + name + '\' first') + } + logger.error('Error in %s plugin', name) + logger.error(err) + throw err } // each plugin MUST implement those