Skip to content

Commit f77b648

Browse files
committed
Log module name in failure
1 parent b50d446 commit f77b648

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sbt-plugin/src/main/scala/ch/epfl/scala/GithubDependencyGraphPlugin.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ object GithubDependencyGraphPlugin extends AutoPlugin {
9797

9898
private def manifestTask: Def.Initialize[Task[Manifest]] = Def.task {
9999
// updateFull is needed to have information about callers and reconstruct dependency tree
100-
val report = Keys.updateFull.value
100+
val reportResult = Keys.updateFull.result.value
101101
val projectID = Keys.projectID.value
102102
val scalaVersion = (Keys.artifactName / Keys.scalaVersion).value
103103
val scalaBinaryVersion = (Keys.artifactName / Keys.scalaBinaryVersion).value
104104
val crossVersion = CrossVersion.apply(scalaVersion, scalaBinaryVersion)
105105
val allDirectDependencies = Keys.allDependencies.value
106106
val baseDirectory = Keys.baseDirectory.value
107+
val logger = Keys.streams.value.log
107108

108109
def getReference(module: ModuleID): String =
109110
crossVersion(module)
@@ -115,6 +116,14 @@ object GithubDependencyGraphPlugin extends AutoPlugin {
115116
val moduleReports = mutable.Buffer[(ModuleReport, ConfigRef)]()
116117
val allDependencies = mutable.Buffer[(String, String)]()
117118

119+
val report = reportResult match {
120+
case Inc(cause) =>
121+
val moduleName = crossVersion(projectID).name
122+
logger.error(s"Failed to resolve the dependencies of $moduleName")
123+
throw cause
124+
case Value(report) => report
125+
}
126+
118127
for {
119128
configReport <- report.configurations
120129
moduleReport <- configReport.modules

0 commit comments

Comments
 (0)