Skip to content

Commit

Permalink
GenIdea: Handle failure when evaluating module sources/resources (bac…
Browse files Browse the repository at this point in the history
…kport com-lihaoyi#3754)

We simply don't swallow the error but propagate it.

Fix com-lihaoyi#3168

Backport of pull request: com-lihaoyi#3754
  • Loading branch information
lefou committed Oct 16, 2024
1 parent 8779978 commit 7e8d652
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 @@ -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
Expand Down

0 comments on commit 7e8d652

Please sign in to comment.