diff --git a/bin/now-alias.js b/bin/now-alias.js index d70cf28..eea5445 100755 --- a/bin/now-alias.js +++ b/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) } diff --git a/bin/now-deploy.js b/bin/now-deploy.js index 4f4eea2..dc71f65 100755 --- a/bin/now-deploy.js +++ b/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) diff --git a/bin/now-domains.js b/bin/now-domains.js index eb190e5..b71b676 100755 --- a/bin/now-domains.js +++ b/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) } diff --git a/bin/now-list.js b/bin/now-list.js index ff7b581..652fc23 100755 --- a/bin/now-list.js +++ b/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) } }) diff --git a/bin/now-remove.js b/bin/now-remove.js index b54472d..bab2202 100755 --- a/bin/now-remove.js +++ b/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) } }) diff --git a/lib/agent.js b/lib/agent.js index 817b8bb..f44b432 100644 --- a/lib/agent.js +++ b/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 diff --git a/lib/build-logger.js b/lib/build-logger.js index 81c2cb3..8a95b1b 100644 --- a/lib/build-logger.js +++ b/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}`) } } } diff --git a/lib/index.js b/lib/index.js index ac9caa1..15f1c9f 100644 --- a/lib/index.js +++ b/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}`) } }