|
|
@ -33,8 +33,7 @@ class ConfigDataNotFoundFailureAnalyzer extends AbstractFailureAnalyzer<ConfigDa
|
|
|
|
protected FailureAnalysis analyze(Throwable rootFailure, ConfigDataNotFoundException cause) {
|
|
|
|
protected FailureAnalysis analyze(Throwable rootFailure, ConfigDataNotFoundException cause) {
|
|
|
|
ConfigDataLocation location = getLocation(cause);
|
|
|
|
ConfigDataLocation location = getLocation(cause);
|
|
|
|
Origin origin = Origin.from(location);
|
|
|
|
Origin origin = Origin.from(location);
|
|
|
|
StringBuilder message = new StringBuilder(
|
|
|
|
String message = String.format("Config data %s does not exist", cause.getReferenceDescription());
|
|
|
|
String.format("Config data %s does not exist", cause.getReferenceDescription()));
|
|
|
|
|
|
|
|
StringBuilder action = new StringBuilder("Check that the value ");
|
|
|
|
StringBuilder action = new StringBuilder("Check that the value ");
|
|
|
|
if (location != null) {
|
|
|
|
if (location != null) {
|
|
|
|
action.append(String.format("'%s' ", location));
|
|
|
|
action.append(String.format("'%s' ", location));
|
|
|
@ -46,7 +45,7 @@ class ConfigDataNotFoundFailureAnalyzer extends AbstractFailureAnalyzer<ConfigDa
|
|
|
|
if (location != null && !location.isOptional()) {
|
|
|
|
if (location != null && !location.isOptional()) {
|
|
|
|
action.append(String.format(", or prefix it with '%s'", ConfigDataLocation.OPTIONAL_PREFIX));
|
|
|
|
action.append(String.format(", or prefix it with '%s'", ConfigDataLocation.OPTIONAL_PREFIX));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new FailureAnalysis(message.toString(), action.toString(), cause);
|
|
|
|
return new FailureAnalysis(message, action.toString(), cause);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ConfigDataLocation getLocation(ConfigDataNotFoundException cause) {
|
|
|
|
private ConfigDataLocation getLocation(ConfigDataNotFoundException cause) {
|
|
|
|