correct error logging for plugin loading issues
This commit is contained in:
parent
c088e092b8
commit
d179cae2ca
1 changed files with 8 additions and 3 deletions
|
|
@ -83,9 +83,14 @@ function loadPlugin (name, config) {
|
||||||
// each used plugin MUST be installed
|
// each used plugin MUST be installed
|
||||||
try {
|
try {
|
||||||
plugin = require('lamassu-' + name)
|
plugin = require('lamassu-' + name)
|
||||||
} catch (_) {
|
} catch (err) {
|
||||||
throw new Error(name + ' module is not installed. ' +
|
if (err.code === 'MODULE_NOT_FOUND') {
|
||||||
'Try running \'npm install --save lamassu-' + name + '\' first')
|
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
|
// each plugin MUST implement those
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue