From c2d1c54cb9cf9487238e4401e24c80d9c7e668cf 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 (#3754) We simply don't swallow the error but propagate it. Fix https://github.com/com-lihaoyi/mill/issues/3168 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 36323669d62..5706a6add6a 100755 --- a/idea/src/mill/idea/GenIdeaImpl.scala +++ b/idea/src/mill/idea/GenIdeaImpl.scala @@ -501,15 +501,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