-
Notifications
You must be signed in to change notification settings - Fork 25
fix: exitCodes, reporters and bail, better error logging #44
Conversation
Thanks for covering the 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really looks strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
There was a problem hiding this 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
This PR contains a:
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 anticipatingstats
beingundefined
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