From 615750c287fac27c2dafb3ec6f0ba7b5a4946388 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sun, 10 Jul 2016 23:02:42 -0800 Subject: [PATCH] Better error reporting. --- .../main/kotlin/com/beust/kobalt/maven/DependencyManager.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt index 8a1209a8..7b6cd96e 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt @@ -35,10 +35,11 @@ class DependencyManager @Inject constructor(val executors: KobaltExecutors, val // the first one that produces an actual file val result = listOf(File(projectDirectory), Kobalt.context?.internalContext?.absoluteDir).map { File(it, idPath) - }.first { + }.firstOrNull { it.exists() } - result + result ?: throw KobaltException("Couldn't find $id") + } else { File(idPath) }