Skip to content

Commit

Permalink
fix #82
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech authored and Eywek committed Jul 16, 2018
1 parent 671dd19 commit b01f244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/InteractorClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ module.exports = class InteractorDaemonizer {
child.disconnect()

// Handle and show to user the different error message that can happen
if (msg.error === true) {
if (msg.km_data && msg.km_data.error === true) {
if (!process.env.PM2_SILENT) {
console.log(chalk.red('[PM2.IO][ERROR]'), msg.msg)
console.log(chalk.red('[PM2.IO][ERROR]'), msg.km_data.msg)
console.log(chalk.cyan('[PM2.IO]') + ' Contact support [email protected] and send us the error message')
}
return cb(msg)
Expand Down
7 changes: 2 additions & 5 deletions src/InteractorDaemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,19 @@ const InteractorDaemon = module.exports = class InteractorDaemon {
return cb(err)
}

if (data.error === true) {
return cb(new Error(data.msg))
}
this.km_data = data

if (data.disabled === true || data.pending === true) {
log('Interactor is disabled by admins')
return cb(new Error('Interactor disabled, contact us at [email protected] for more informatios'))
}
if (data.active === false) {
log('Interactor not active: %s', data.msg || 'no message')
return cb(null, false)
return cb(null, data)
}

log('Connect transport with endpoints')
this.DAEMON_ACTIVE = true
this.km_data = data
this.transport.connect(data.endpoints, cb)
})
}
Expand Down

0 comments on commit b01f244

Please sign in to comment.