style(error): log stack if available

This commit is contained in:
Stephan Bönnemann 2015-04-21 15:04:12 +02:00
parent 49de103753
commit 615d796f24

View File

@ -7,7 +7,7 @@ module.exports = {
standard: efh(function (err) {
console.log('Something went wrong:')
if (typeof err === 'string') return console.log(err)
if (err instanceof Error) return console.log(err.message)
if (err instanceof Error) return console.log(err.message, err.stack)
if (err.message) return console.log(err.message)
console.log(err)
})