Skip to content

Commit d9c278f

Browse files
committed
feat(env): Catch agent start failure
1 parent 1f1f2e3 commit d9c278f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ private static void agentmainImpl(
155155
final Method startMethod =
156156
agentClass.getMethod("start", Object.class, Instrumentation.class, URL.class, String.class);
157157

158-
startMethod.invoke(null, initTelemetry, inst, agentJarURL, agentArgs);
158+
try {
159+
startMethod.invoke(null, initTelemetry, inst, agentJarURL, agentArgs);
160+
} catch (ReflectiveOperationException | LinkageError e) {
161+
throw new IllegalStateException("Unable to start DD Java Agent.", e);
162+
}
159163
}
160164

161165
static boolean getConfig(String configName) {

0 commit comments

Comments
 (0)