Skip to content

Commit

Permalink
GenIdea: Handle failure when evaluating module sources/resources (#3754)
Browse files Browse the repository at this point in the history
We simply don't swallow the error but propagate it.

Fix #3168

Pull request: #3754
  • Loading branch information
lefou authored Oct 16, 2024
1 parent b9fbaad commit c2d1c54
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions idea/src/mill/idea/GenIdeaImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2d1c54

Please sign in to comment.