Skip to content

Commit

Permalink
Merge pull request #2200 from tgodzik/better-errors
Browse files Browse the repository at this point in the history
chore: Print better errors when bloopInstall failed
  • Loading branch information
tgodzik authored Nov 23, 2023
2 parents a4d4a27 + dea5813 commit 2ee4293
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,22 @@ object BloopDefaults {
)
.map(fail =>
if (fail.nonEmpty) {
logger.error(s"Couldn't run bloopGenerate. Cause: ${fail.mkString("\n")}")
val messages = fail.flatMap { incomplete =>
incomplete.directCause.zip(incomplete.message)
}

if (messages.nonEmpty) {
logger.error(s"Couldn't run bloopGenerate. The issue might be caused by:")
messages.foreach {
case (t, message) =>
logger.error(message)
logger.trace(t)
}
} else {
logger.error(
s"Couldn't run bloopGenerate. The issue could be caused by failing to compile the project."
)
}
throw fail.head
}
)
Expand Down

0 comments on commit 2ee4293

Please sign in to comment.