From 12c419054a43c316beaf012ab6570b632f9ddb09 Mon Sep 17 00:00:00 2001 From: davidbilge Date: Fri, 7 Aug 2020 09:29:19 +0200 Subject: [PATCH 1/2] 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 c7daad6af39..25a6640933a 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); } } } From 333af3d4e7705314154ba7da48197fc3d8eeb78b Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 10 Aug 2020 14:21:44 +0200 Subject: [PATCH 2/2] Polish "Propagate the cause that led Reactor"s debug agent to fail" 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 25a6640933a..6268e8b67c9 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.