From bf345f8f468d31c60c5f900ebb9300ce3c775754 Mon Sep 17 00:00:00 2001 From: jmatsuok Date: Fri, 19 Apr 2024 16:44:20 -0400 Subject: [PATCH] Fix spotbugs warning --- src/main/java/io/cryostat/jmcagent/JMCAgent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/cryostat/jmcagent/JMCAgent.java b/src/main/java/io/cryostat/jmcagent/JMCAgent.java index b15c879b4..0a798afb2 100644 --- a/src/main/java/io/cryostat/jmcagent/JMCAgent.java +++ b/src/main/java/io/cryostat/jmcagent/JMCAgent.java @@ -24,6 +24,7 @@ import io.cryostat.V2Response; import io.cryostat.core.agent.AgentJMXHelper; +import io.cryostat.core.agent.AgentJMXHelper.ProbeDefinitionException; import io.cryostat.core.agent.Event; import io.cryostat.core.agent.ProbeTemplate; import io.cryostat.core.sys.FileSystem; @@ -84,7 +85,7 @@ public Response postProbe(@RestPath long id, @RestPath String probeTemplateName) TEMPLATE_APPLIED_CATEGORY, Map.of("probeTemplate", template.getFileName()))); return Response.status(RestResponse.Status.OK).build(); - } catch (Exception e) { + } catch (ProbeDefinitionException e) { // Cleanup the probes if something went wrong, calling defineEventProbes // with a null argument will remove any active probes. helper.defineEventProbes(null);