Skip to content

Commit

Permalink
Fix spotbugs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Matsuoka committed Apr 19, 2024
1 parent 5ce7b61 commit bf345f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/cryostat/jmcagent/JMCAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bf345f8

Please sign in to comment.