From 12c419054a43c316beaf012ab6570b632f9ddb09 Mon Sep 17 00:00:00 2001 From: davidbilge Date: Fri, 7 Aug 2020 09:29:19 +0200 Subject: [PATCH] Propagate the cause that led Reactor"s debug agent to fail Prior to this commit, DebugAgentEnvironmentPostProcessor throws a RuntimeException with a generic error message if its initialization fails. The causing exception is discarded, which makes error analysis unnecessarily difficult. This commit attaches the cause to the newly thrown RuntimeException. See gh-22777 --- .../boot/reactor/DebugAgentEnvironmentPostProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessor.java index c7daad6af3..25a6640933 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/reactor/DebugAgentEnvironmentPostProcessor.java @@ -49,7 +49,7 @@ public class DebugAgentEnvironmentPostProcessor implements EnvironmentPostProces debugAgent.getMethod("init").invoke(null); } catch (Exception ex) { - throw new RuntimeException("Failed to init Reactor's debug agent"); + throw new RuntimeException("Failed to init Reactor's debug agent", ex); } } }