diff --git a/.idea/misc.xml b/.idea/misc.xml index 5f5674a85..86c1552fc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/agent/src/main/java/com/teamscale/jacoco/agent/AgentBase.java b/agent/src/main/java/com/teamscale/jacoco/agent/AgentBase.java index 0c673ebac..9028442db 100644 --- a/agent/src/main/java/com/teamscale/jacoco/agent/AgentBase.java +++ b/agent/src/main/java/com/teamscale/jacoco/agent/AgentBase.java @@ -115,6 +115,14 @@ private ServletContextHandler buildUsingResourceConfig() { void registerShutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { + if (true) { + try { + throw new RuntimeException("trying warning with error"); + } catch (Exception e) { + logger.warn("warning with stack trace", e); + } + throw new RuntimeException("Simulated failure during shutdown hook"); + } logger.info("CQSE JaCoCo agent is shutting down..."); stopServer(); prepareShutdown();