Skip to content

Commit dfcddf0

Browse files
Merge pull request #269 from checkmarx-ltd/pr-logginggitissue
Adding Git API exception
2 parents f264610 + b392fac commit dfcddf0

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<artifactId>cx-spring-boot-sdk</artifactId>
1313

1414

15-
<version>0.5.28</version>
15+
<version>0.5.29</version>
1616

1717

1818
<name>cx-spring-boot-sdk</name>

src/main/java/com/checkmarx/sdk/utils/CxRepoFileHelper.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,18 @@ else if (gitURL.contains("@bitbucket.org")) {
176176
log.info("credentialsProvider without password");
177177
}
178178
log.info("Cloning code locally to {}", pathFile);
179-
Git.cloneRepository()
180-
.setURI(gitURL)
181-
.setBranch(branch)
182-
.setBranchesToClone(Collections.singleton(branch))
183-
.setDirectory(pathFile)
184-
.setCredentialsProvider(credentialsProvider)
185-
.call()
186-
.close();
179+
try {
180+
Git.cloneRepository()
181+
.setURI(gitURL)
182+
.setBranch(branch)
183+
.setBranchesToClone(Collections.singleton(branch))
184+
.setDirectory(pathFile)
185+
.setCredentialsProvider(credentialsProvider)
186+
.call()
187+
.close();
188+
} catch (GitAPIException e) {
189+
log.error("API Exception : ",e);
190+
}
187191
}
188192

189193
private void runPostCloneScript(CxScanParams params, String path) {

0 commit comments

Comments
 (0)