Skip to content

Commit 5c9ac0b

Browse files
committed
Update MultipleJGitEnvironmentRepository.findOne to add original exception as suppressed
1 parent 579a3cd commit 5c9ac0b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepository.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ public Environment findOne(String application, String profile, String label, boo
175175
catch (Exception e) {
176176
if (MultipleJGitEnvironmentProperties.MAIN_LABEL.equals(label) && isTryMasterBranch()) {
177177
candidate = getRepository(this, application, profile, MultipleJGitEnvironmentProperties.MASTER_LABEL);
178-
return findOneFromCandidate(candidate, application, profile,
178+
try {
179+
return findOneFromCandidate(candidate, application, profile,
179180
MultipleJGitEnvironmentProperties.MASTER_LABEL, includeOrigin);
181+
}
182+
catch (Exception e1) {
183+
e1.addSuppressed(e); // add the original exception as suppressed
184+
throw e1;
185+
}
180186
}
181187
throw e;
182188
}

0 commit comments

Comments
 (0)