Skip to content

Commit 09f9fa1

Browse files
authored
Merge pull request #78 from tanishiking/show-error-corrupt
Implement error method with an additinal error message and cause
2 parents ed2efe2 + ecd4902 commit 09f9fa1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

plugin/src/main/scala/org/scalafmt/sbt/ScalafmtSbtReporter.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ class ScalafmtSbtReporter(log: Logger, out: OutputStreamWriter)
2424
}
2525
}
2626

27+
override def error(file: Path, message: String, e: Throwable): Unit = {
28+
if (e.getMessage != null) {
29+
error(file, s"$message: ${e.getMessage()}")
30+
} else {
31+
throw new FailedToFormat(file.toString, e)
32+
}
33+
}
34+
2735
override def excluded(file: Path): Unit =
2836
log.debug(s"file excluded: $file")
2937

0 commit comments

Comments
 (0)