From a046b198645811fe1b7db129942505c379aabb03 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 17 Dec 2024 23:07:06 +0100 Subject: feat: Add name prefetching --- .../kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt') diff --git a/src/main/kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt b/src/main/kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt index df588a8..96b70ec 100644 --- a/src/main/kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt +++ b/src/main/kotlin/moe/nea/ledger/utils/telemetry/ExceptionContextValue.kt @@ -22,8 +22,9 @@ class ExceptionContextValue(val exception: Throwable) : ContextValue { obj.addProperty("message", exception.message) // TODO: allow exceptions to implement an "extra info" interface if (searchDepth > 0) { - if (exception.cause != null) { - obj.add("cause", walkExceptions(exception, searchDepth - 1)) + val cause = exception.cause + if (cause != null && cause !== exception) { + obj.add("cause", walkExceptions(cause, searchDepth - 1)) } val suppressions = JsonArray() for (suppressedException in exception.suppressedExceptions) { -- cgit