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

Commit

Permalink
Merge pull request #67 from alebiavati/output-formatted-errors
Browse files Browse the repository at this point in the history
added formatted error messages to exeption
  • Loading branch information
MoOx committed Nov 1, 2015
2 parents 128c866 + da819f4 commit 4da6f14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ function lint(input, config, webpack, callback) {
if (emitter) {
emitter(messages)
if (config.failOnError && res.errorCount) {
throw new Error("Module failed because of a eslint error.")
throw new Error("Module failed because of a eslint error.\n"
+ messages)
}
else if (config.failOnWarning && res.warningCount) {
throw new Error("Module failed because of a eslint warning.")
throw new Error("Module failed because of a eslint warning.\n"
+ messages)
}
}
else {
Expand Down

0 comments on commit 4da6f14

Please sign in to comment.