diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt index b16de7ec8..82e09ad13 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.kt @@ -118,10 +118,12 @@ public open class ShadowCopyAction internal constructor( processTransformers(outputStream) } } catch (e: IOException) { - throw Zip64RequiredException( - "${e.cause?.message}\n\nTo build this archive, please enable the zip64 extension.\n" + - "See: ${documentationRegistry.getDslRefForProperty(Zip::class.java, "zip64")}", - ) + if (e.cause is Zip64RequiredException) { + throw Zip64RequiredException( + "${e.cause?.message}\n\nTo build this archive, please enable the zip64 extension.\n" + + "See: ${documentationRegistry.getDslRefForProperty(Zip::class.java, "zip64")}", + ) + } } return WorkResults.didWork(true) }