carnesen / cli

A command-line interface (CLI) framework for Node.js and web browser
https://cli.carnesen.com
MIT License
5 stars 0 forks source link

Unexpected handling of exception with numeric "code" property #166

Closed carnesen closed 3 years ago

carnesen commented 3 years ago

Currently, if the action throws an exception with a numeric "code" property, we only log the exception's "message" property. That's unexpected and unintentional. Instead it should console.error the whole error and simply use the numeric code for the exit code. https://github.com/carnesen/cli/blob/3c513377735bc72d125a31e6bb50964e9020d412/main/src/cli-run.ts#L70-L74