fix: print full exception when patch fails

This commit is contained in:
oSumAtrIX 2022-12-18 00:34:16 +01:00
parent 88bb3a8845
commit 7cf79e68e0
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -399,9 +399,10 @@ class Patcher(private val options: PatcherOptions) {
val result = executePatch(dependency, executedPatches) val result = executePatch(dependency, executedPatches)
if (result.isSuccess()) return@forEach if (result.isSuccess()) return@forEach
val error = result.error()!! return PatchResultError(
val errorMessage = error.cause ?: error.message "'$patchName' depends on '${dependency.patchName}' but the following error was raised: " +
return PatchResultError("'$patchName' depends on '${dependency.patchName}' but the following error was raised: $errorMessage") result.error()!!.let { it.cause?.stackTraceToString() ?: it.message }
)
} }
val isResourcePatch = ResourcePatch::class.java.isAssignableFrom(patchClass) val isResourcePatch = ResourcePatch::class.java.isAssignableFrom(patchClass)