CF hints provider is still propagating error without conversion

If a no-targets exception is caught, it is still being propagate as-is
to the framework, and the extra logic to avoid appended information does
not get called.
This commit is contained in:
nsingh
2017-01-24 15:23:47 -08:00
parent e43da3d6d4
commit e35ae2e0c9

View File

@@ -53,9 +53,12 @@ public abstract class AbstractCFHintsProvider implements Callable<Collection<YVa
// are generated by the target provider so they should be propagated
// as is without further
// transformation
if (ExceptionUtil.getThrowable(e, NoTargetsException.class) == null) {
Throwable noTargetsError = ExceptionUtil.getThrowable(e, NoTargetsException.class);
if (noTargetsError != null) {
throw new ValueParseException(ExceptionUtil.getMessage(noTargetsError));
} else {
// Log any other error
logger.log(Level.SEVERE, e.getMessage(), e);
logger.log(Level.SEVERE, ExceptionUtil.getMessage(e), e);
if (ExceptionUtil.getThrowable(e, IOException.class) != null) {
throw new ValueParseException(
@@ -65,8 +68,6 @@ public abstract class AbstractCFHintsProvider implements Callable<Collection<YVa
throw new ValueParseException(
"Failed to fetch values from Cloud Foundry. Please check the log for more details.");
}
} else {
throw e;
}
}
return hints;