Skip to content

Commit

Permalink
Merge pull request #78 from tanishiking/show-error-corrupt
Browse files Browse the repository at this point in the history
Implement error method with an additinal error message and cause
  • Loading branch information
tanishiking authored Jan 18, 2020
2 parents ed2efe2 + ecd4902 commit 09f9fa1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ class ScalafmtSbtReporter(log: Logger, out: OutputStreamWriter)
}
}

override def error(file: Path, message: String, e: Throwable): Unit = {
if (e.getMessage != null) {
error(file, s"$message: ${e.getMessage()}")
} else {
throw new FailedToFormat(file.toString, e)
}
}

override def excluded(file: Path): Unit =
log.debug(s"file excluded: $file")

Expand Down

0 comments on commit 09f9fa1

Please sign in to comment.