Skip to content

Commit

Permalink
fix: when wrong secret/public (statusCode>200) return proper msg to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Aug 21, 2018
1 parent 8ee11c5 commit 6359e8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/InteractorDaemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,9 @@ const InteractorDaemon = module.exports = class InteractorDaemon {
return cb(err)
}

this.km_data = data

// Verify data integrity
if (!data.endpoints || data.active == false) {
console.trace(data)
return cb(new Error('Endpoints field not present or not active'))
}

if (data.disabled === true || data.pending === true) {
log('Interactor is disabled by admins')
Expand All @@ -272,7 +270,10 @@ const InteractorDaemon = module.exports = class InteractorDaemon {
return cb(null, data)
}

this.km_data = data
if (!data.endpoints || data.active == false) {
console.trace(data)
return cb(new Error('Endpoints field not present or not active'))
}

this.DAEMON_ACTIVE = true
this.transport.connect(data.endpoints, cb)
Expand Down
1 change: 0 additions & 1 deletion src/Utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ class HTTPClient {
}

const req = http.request(options, (res) => {
if (res.statusCode > 200) return cb(new Error(`Non 200 status code received: ${res.statusCode}`))
let body = ''

res.setEncoding('utf8')
Expand Down

0 comments on commit 6359e8a

Please sign in to comment.