Browse Source

Ensured correct output for error messages (#694)

* add await to responseError calls

* add await to login(apiUrl) calls
master
Igor Klopov 8 years ago
committed by Leo Lamprecht
parent
commit
ebcda315a5
  1. 2
      bin/now-logs.js
  2. 2
      bin/now-remove.js
  3. 4
      lib/index.js

2
bin/now-logs.js

@ -115,7 +115,7 @@ Promise.resolve()
let token
try {
token = config.token || login(apiUrl)
token = config.token || (await login(apiUrl))
} catch (err) {
error(`Authentication error – ${err.message}`)
process.exit(1)

2
bin/now-remove.js

@ -91,7 +91,7 @@ Promise.resolve()
let token
try {
token = config.token || login(apiUrl)
token = config.token || (await login(apiUrl))
} catch (err) {
error(`Authentication error – ${err.message}`)
process.exit(1)

4
lib/index.js

@ -382,7 +382,7 @@ module.exports = class Now extends EventEmitter {
if (this._debug) {
console.log('> [debug] bailing on listing due to %s', res.status)
}
return bail(responseError(res))
return bail(await responseError(res))
}
if (res.status !== 200) {
@ -417,7 +417,7 @@ module.exports = class Now extends EventEmitter {
if (this._debug) {
console.log('> [debug] bailing on listing due to %s', res.status)
}
return bail(responseError(res))
return bail(await responseError(res))
}
if (res.status !== 200) {

Loading…
Cancel
Save