diff --git a/vscode-extensions/vscode-manifest-yaml/src/main/java/org/springframework/ide/vscode/manifest/yaml/AbstractCFHintsProvider.java b/vscode-extensions/vscode-manifest-yaml/src/main/java/org/springframework/ide/vscode/manifest/yaml/AbstractCFHintsProvider.java index 58734d6e0..9c58f498e 100644 --- a/vscode-extensions/vscode-manifest-yaml/src/main/java/org/springframework/ide/vscode/manifest/yaml/AbstractCFHintsProvider.java +++ b/vscode-extensions/vscode-manifest-yaml/src/main/java/org/springframework/ide/vscode/manifest/yaml/AbstractCFHintsProvider.java @@ -49,22 +49,27 @@ public abstract class AbstractCFHintsProvider implements Callable resolvedHints = getHints(targets); hints.addAll(resolvedHints); } catch (Throwable e) { - // Don't log the no target found error. Just inform the user - if (ExceptionUtil.getThrowable(e, NoTargetsException.class) != null) { - hints.add(new BasicYValueHint(EMPTY_VALUE, e.getMessage())); - } else { - + // Convert any non "no-target" errors to something useful. The + // "no-target" errors + // are generated by the target provider so they should be propagated + // as is without further + // transformation + if (ExceptionUtil.getThrowable(e, NoTargetsException.class) == null) { // Log any other error logger.log(Level.SEVERE, e.getMessage(), e); if (ExceptionUtil.getThrowable(e, IOException.class) != null) { - hints.add(new BasicYValueHint(EMPTY_VALUE, - "Connection failure to Cloud Foundry. Please check the log for more details.")); + throw ExceptionUtil.exception( + "Connection failure to Cloud Foundry. Please check the log for more details.", e); + } else { - hints.add(new BasicYValueHint(EMPTY_VALUE, - "Failed to fetch values from Cloud Foundry. Please check the log for more details.")); + throw ExceptionUtil.exception( + "Failed to fetch values from Cloud Foundry. Please check the log for more details.", e); } } + else { + throw e; + } } return hints; }