Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report errors by console-logging and exit code #76

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

jasonkarns
Copy link
Member

Scripty is presently swallowing errors.
This behavior was introduced with d7a1296
presumably to silence noisy errors caused by the scripts themselves.

However, this has the side effect of also muting errors raised by
scripty itself.

For instance, the common error of scripty being invoked but unable to
find a script to execute. In such a scenario, (even when not silent),
the only output printed is:

$ npm run bar

> [email protected] bar /path/to/foo
> scripty

What's worse, it exits with a zero (successful) status code.

This change ensures errors from scripty are logged to STDERR and exits
with a nonzero status code.
It also makes any script errors a bit noisier (as they were before),
but that should be resolved separately with the more configurable
logging levels.

Scripty is presently swallowing errors.
This behavior was introduced with d7a1296
presumably to silence noisy errors caused by the scripts themselves.

However, this has the side effect of _also_ muting errors raised by
scripty itself.

For instance, the common error of scripty being invoked but unable to
find a script to execute. In such a scenario, (even when not silent),
the only output printed is:

```
$ npm run bar

> [email protected] bar /path/to/foo
> scripty

```

What's worse, it exits with a zero (successful) status code.

This change ensures errors from scripty are logged to STDERR and exits
with a nonzero status code.
It _also_ makes any script errors a bit noisier (as they were before),
but that should be resolved separately with the more configurable
logging levels.
@codeclimate
Copy link

codeclimate bot commented Dec 19, 2018

Code Climate has analyzed commit a0e878a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 99.3% (0.0% change).

View more on Code Climate.

@jasonkarns jasonkarns merged commit d3f9969 into master Dec 19, 2018
@jasonkarns jasonkarns deleted the stop-swallowing-errors branch December 19, 2018 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant