Skip to content

Commit 9a2b34d

Browse files
authored
handle exception from retrieving git info (#10853)
handle exception from retrieving git info wrap calls to GitInfo avoid bubling up exceptions Co-authored-by: jean-philippe.bempel <jean-philippe.bempel@datadoghq.com>
1 parent c8a3897 commit 9a2b34d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerAgent.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,15 @@ private static DebuggerSink createDebuggerSink(
371371
}
372372

373373
public static String getDefaultTagsMergedWithGlobalTags(Config config) {
374-
GitInfo gitInfo = GitInfoProvider.INSTANCE.getGitInfo();
375-
String gitSha = gitInfo.getCommit().getSha();
376-
String gitUrl = gitInfo.getRepositoryURL();
374+
String gitSha = null;
375+
String gitUrl = null;
376+
try {
377+
GitInfo gitInfo = GitInfoProvider.INSTANCE.getGitInfo();
378+
gitSha = gitInfo.getCommit().getSha();
379+
gitUrl = gitInfo.getRepositoryURL();
380+
} catch (Exception e) {
381+
LOGGER.error("Failed to retrieve git info: ", e);
382+
}
377383
String debuggerTags =
378384
TagsHelper.concatTags(
379385
"env:" + config.getEnv(),

0 commit comments

Comments
 (0)