Browse Source

Log erros and stacktraces (#276)

master
Jarmo Isotalo 8 years ago
committed by Leo Lamprecht
parent
commit
e71cdb8440
  1. 2
      bin/now-alias.js
  2. 6
      bin/now-deploy.js
  3. 2
      bin/now-domains.js
  4. 2
      bin/now-list.js
  5. 2
      bin/now-remove.js
  6. 2
      lib/agent.js
  7. 2
      lib/build-logger.js
  8. 2
      lib/index.js

2
bin/now-alias.js

@ -104,7 +104,7 @@ if (argv.help) {
if (err.userError) {
error(err.message)
} else {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
}
exit(1)
}

6
bin/now-deploy.js

@ -199,7 +199,7 @@ if (argv.h || argv.help) {
process.exit(0)
} else {
sync(token).catch(err => {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
process.exit(1)
})
}
@ -210,7 +210,7 @@ if (argv.h || argv.help) {
})
} else {
sync(argv.token || config.token).catch(err => {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
process.exit(1)
})
}
@ -474,7 +474,7 @@ async function sync(token) {
})
} catch (err) {
if (debug) {
console.log(`> [debug] error: ${err.stack}`)
console.log(`> [debug] error: ${err}\n${err.stack}`)
}
handleError(err)

2
bin/now-domains.js

@ -125,7 +125,7 @@ if (argv.help || !subcommand) {
if (err.userError) {
error(err.message)
} else {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
}
exit(1)
}

2
bin/now-list.js

@ -73,7 +73,7 @@ Promise.resolve(argv.token || config.token || login(apiUrl))
try {
await list(token)
} catch (err) {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
process.exit(1)
}
})

2
bin/now-remove.js

@ -111,7 +111,7 @@ Promise.resolve(argv.token || config.token || login(apiUrl))
try {
await remove(token)
} catch (err) {
error(`Unknown error: ${err.stack}`)
error(`Unknown error: ${err}\n${err.stack}`)
process.exit(1)
}
})

2
lib/agent.js

@ -39,7 +39,7 @@ module.exports = class Agent {
_onError(err, agent) {
if (this._debug) {
console.log('> [debug] agent connection error', err.stack)
console.log(`> [debug] agent connection error ${err}\n${err.stack}`)
}
if (this._agent === agent) {
this._agent = null

2
lib/build-logger.js

@ -115,7 +115,7 @@ module.exports = class Logger extends EventEmitter {
onSocketError(err) {
if (this.debug) {
console.log('> [debug] Socket error', err.stack)
console.log(`> [debug] Socket error ${err}\n${err.stack}`)
}
}
}

2
lib/index.js

@ -637,7 +637,7 @@ module.exports = class Now extends EventEmitter {
_onRetry(err) {
if (this._debug) {
console.log(`> [debug] Retrying: ${err.stack}`)
console.log(`> [debug] Retrying: ${err}\n${err.stack}`)
}
}

Loading…
Cancel
Save