Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

fix: exitCodes, reporters and bail, better error logging #44

Merged
merged 4 commits into from
Jul 6, 2018

Conversation

shellscape
Copy link
Contributor

@shellscape shellscape commented Jul 5, 2018

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

It's been reported that #35 didn't do enough to address exit codes in the event of a build failure or error. During discovery, it was also found that the --bail flag will cause errors in the reporters as well, as they were not anticipating stats being undefined in the event that --bail was used.

Additionally, the logic for how an error is displayed when one occurs at the program level (outside of reporters) has been improved greatly and gives users more options to display additional info.

Breaking Changes

None

Additional Info

/cc @ankurk91 @MrMamen

@ankurk91
Copy link

ankurk91 commented Jul 5, 2018

Thanks for covering the --bail issue. I was about to report that.

This PR also might fix -#31

lib/compiler.js Outdated
@@ -29,6 +35,10 @@ function makeCallback(options) {
if (error) {
reject(error);
return;
} else if (stats && stats.hasErrors() && !watch) {
process.exitCode = getErrorCount(stats);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 1 instead. Using the error count as the exit code when prevent us from using meaningful non-zero exit codes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really looks strange

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about exit code

@shellscape shellscape merged commit 251d293 into master Jul 6, 2018
@shellscape shellscape deleted the fix/exitcode-bail-log branch July 6, 2018 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants