Skip to content

Commit

Permalink
improve error message when async expression fails
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Jun 8, 2019
1 parent 5e63354 commit 86dcd47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -178,4 +178,8 @@ function getTilesize({imageWidth, argv}) {
previousSlice = slice
}
print(EOL)
})().catch(console.error)
})().catch(error => {
let message = error ? error.toString() : "something threw nothing"
process.stderr.write(message + EOL)
process.exit(1)
})

0 comments on commit 86dcd47

Please sign in to comment.