Fixed bug where no-targets error still contains appended information
This commit is contained in:
@@ -68,6 +68,17 @@ public class ExceptionUtil {
|
||||
return "An error occurred: " + getSimpleError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getMessageNoAppendedInformation(Throwable e) {
|
||||
Throwable deepestCause = ExceptionUtil.getDeepestCause(e);
|
||||
String msg = deepestCause != null ? deepestCause.getMessage() : null;
|
||||
|
||||
if (StringUtil.hasText(msg)) {
|
||||
return msg;
|
||||
} else {
|
||||
return "An error occurred: " + getSimpleError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSimpleError(Throwable e) {
|
||||
return e.getClass().getSimpleName();
|
||||
|
||||
@@ -186,12 +186,7 @@ public class YTypeAssistContext extends AbstractYamlAssistContext {
|
||||
|
||||
// If value parse exception, do not append any additional information
|
||||
if (e instanceof ValueParseException) {
|
||||
String msg = e.getMessage();
|
||||
if (StringUtil.hasText(msg)) {
|
||||
return msg;
|
||||
} else {
|
||||
return "An error occurred: " + getSimpleError(e);
|
||||
}
|
||||
return ExceptionUtil.getMessageNoAppendedInformation(e);
|
||||
} else {
|
||||
return ExceptionUtil.getMessage(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user