fix: Use Patch#toString to get patch class name, when no name available

This commit is contained in:
oSumAtrIX 2024-01-27 04:05:52 +01:00
parent 9fc42e132c
commit c9a82608f7
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -140,7 +140,7 @@ class Patcher(
patch: Patch<*>,
executedPatches: LinkedHashMap<Patch<*>, PatchResult>,
): PatchResult {
val patchName = patch.name ?: patch.toString()
val patchName = patch.toString()
executedPatches[patch]?.let { patchResult ->
patchResult.exception ?: return patchResult
@ -237,7 +237,7 @@ class Patcher(
PatchResult(
patch,
PatchException(
"'${patch.name}' raised an exception while being closed: ${it.stackTraceToString()}",
"'$patch' raised an exception while being closed: ${it.stackTraceToString()}",
result.exception,
),
),