Skip to content

Commit

Permalink
TS-31571 Rework: Keep the exception type when re-throwing
Browse files Browse the repository at this point in the history
stahlbauer committed Nov 6, 2024
1 parent 0465e2d commit eed5d12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agent/src/main/java/com/teamscale/jacoco/agent/PreMain.java
Original file line number Diff line number Diff line change
@@ -75,8 +75,10 @@ public static void premain(String options, Instrumentation instrumentation) thro
environmentConfigFile);
agentOptions = parseResult.getFirst();

// After parsing everything and configuring logging, we now
// can throw the caught exceptions.
for (Exception exception : parseResult.getSecond()) {
throw new AgentOptionParseException("Failed to parse options: " + exception.getMessage(), exception);
throw exception;
}
} catch (AgentOptionParseException e) {
getLoggerContext().getLogger(PreMain.class).error(e.getMessage(), e);
@@ -155,7 +157,6 @@ private static Pair<AgentOptions, List<Exception>> getAndApplyAgentOptions(Strin
delayedLogger.logTo(logger);
HttpUtils.setShouldValidateSsl(agentOptions.shouldValidateSsl());


return parseResult;
}

0 comments on commit eed5d12

Please sign in to comment.