From 7e8d652a60f3231245f12cdc0ca0dd2c0d815244 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Wed, 16 Oct 2024 17:23:49 +0200 Subject: [PATCH] GenIdea: Handle failure when evaluating module sources/resources (backport #3754) We simply don't swallow the error but propagate it. Fix https://github.com/com-lihaoyi/mill/issues/3168 Backport of pull request: https://github.com/com-lihaoyi/mill/pull/3754 --- idea/src/mill/idea/GenIdeaImpl.scala | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/idea/src/mill/idea/GenIdeaImpl.scala b/idea/src/mill/idea/GenIdeaImpl.scala index b6dd6b494c7..5db2d6fd72f 100755 --- a/idea/src/mill/idea/GenIdeaImpl.scala +++ b/idea/src/mill/idea/GenIdeaImpl.scala @@ -499,15 +499,16 @@ case class GenIdeaImpl( resourcesPathRefs: Seq[PathRef], generatedSourcePathRefs: Seq[PathRef], allSourcesPathRefs: Seq[PathRef] - ) = evaluator.evaluate( - Agg( - mod.resources, - mod.generatedSources, - mod.allSources - ) - ) - .values - .map(_.value) + ) = evaluator.evalOrThrow( + exceptionFactory = r => + GenIdeaException( + s"Could not evaluate sources/resouces of module `${mod}`: ${Evaluator.formatFailing(r)}" + ) + )(Seq( + mod.resources, + mod.generatedSources, + mod.allSources + )) val generatedSourcePaths = generatedSourcePathRefs.map(_.path) val normalSourcePaths = (allSourcesPathRefs