-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Is your feature request related to a problem? Please describe.
Hi! I'm newbie on spring config and frustrated by the 404 error on my config server
the error log is like no such label master
I google the error and the answer is like add default-label @ application.properties
spring.cloud.config.server.git.default-label= main
but it did not solve the problem.
Now I Found That default label is now main @ defulat
and the tryMaster feature was added due to maintain compatibility
related commit
above was my story of how i get to this suggestion.
I hope the method MultipleJGitEnvironmentRepository.findOne
provide a little more kind log or exception handling
in blow lines
line 175
catch (Exception e) {
if (MultipleJGitEnvironmentProperties.MAIN_LABEL.equals(label) && isTryMasterBranch()) {
candidate = getRepository(this, application, profile, MultipleJGitEnvironmentProperties.MASTER_LABEL);
return findOneFromCandidate(candidate, application, profile,
MultipleJGitEnvironmentProperties.MASTER_LABEL, includeOrigin);
}
throw e;
}
if the error is catched and then it try again on master branch
if another error is throw while try on master branch.
it just eat the original exception which is thrown by first try (main branch) !!!
Describe the solution you'd like
A clear and concise description of what you want to happen.
I want to add simple log for original exception.
Additional context
the log i expected
i solve my problem and got to know actual exception by set
spring.cloud.config.server.git.try-master-branch: false