Skip to content

Commit

Permalink
add error to shutdown hook to see if it's being logged
Browse files Browse the repository at this point in the history
  • Loading branch information
karottenreibe committed Nov 15, 2024
1 parent fc7cc66 commit 2f0a93a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions agent/src/main/java/com/teamscale/jacoco/agent/AgentBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2f0a93a

Please sign in to comment.