Skip to content

Commit 27edd3e

Browse files
committed
Rethrow failures in FinishEvent
Fixes #103
1 parent edb2d4d commit 27edd3e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

plugin/src/main/kotlin/org/gradle/dependencygraph/extractor/DependencyExtractor.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,16 @@ abstract class DependencyExtractor :
101101
val details: D? = buildOperation.details.let {
102102
if (it is D) it else null
103103
}
104-
val result: R? = finishEvent.result.let {
105-
if (it is R) it else null
104+
if (details == null) {
105+
return // Ignore other build operation types
106106
}
107-
if (details == null && result == null) {
108-
return
109-
} else if (details == null || result == null) {
110-
throw IllegalStateException("buildOperation.details & finishedEvent.result were unexpected types")
107+
108+
val failure = finishEvent.failure
109+
if (failure != null) {
110+
throw failure
111111
}
112+
113+
val result: R = finishEvent.result as R
112114
handler(details, result)
113115
}
114116

0 commit comments

Comments
 (0)