From b5eb8c4087d0c310522e92794634dd76c53b93fe Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Mon, 7 Jun 2021 18:32:46 +0300 Subject: [PATCH] Document message identity in debugging.md Addresses #1931 --- docs/topics/debugging.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/topics/debugging.md b/docs/topics/debugging.md index d18df7f465..87a7fbe555 100644 --- a/docs/topics/debugging.md +++ b/docs/topics/debugging.md @@ -63,7 +63,9 @@ Exception copy logic is straightforward: 1) If the exception class implements [CopyableThrowable], [CopyableThrowable.createCopy] is used. `null` can be returned from `createCopy` to opt-out specific exception from being recovered. 2) If the exception class has class-specific fields not inherited from Throwable, the exception is not copied. - 3) Otherwise, one of the public exception's constructor is invoked reflectively with an optional `initCause` call. + 3) Otherwise, one of the public exception's constructor is invoked reflectively with an optional `initCause` call. + 4) If the reflective copy has a changed message (exception class modifies 'message' parameter before passing it to the superclass), + the exception is not copied in order to preserve a human-readable message. [CopyableThrowable] does not have such limitation. ## Debug agent