Skip to content

Commit

Permalink
Implement error method with an additinal erro message and cause
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishiking committed Jan 16, 2020
1 parent ed2efe2 commit ecd4902
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 ecd4902

Please sign in to comment.