Merge branch 'master' of github.com:spring-projects/sts4
This commit is contained in:
@@ -64,6 +64,19 @@ public class ExceptionUtil {
|
||||
String msg = cause.getClass().getSimpleName() + ": " + cause.getMessage();
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
* @return a nicer message suitable for display to the user
|
||||
*/
|
||||
public static String getMessageForUserDisplay(Throwable e) {
|
||||
// The message of nested exception is usually more interesting than the
|
||||
// one on top.
|
||||
Throwable cause = getDeepestCause(e);
|
||||
String msg = cause.getMessage();
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static IllegalStateException notImplemented(String string) {
|
||||
return new IllegalStateException("Not implemented: " + string);
|
||||
|
||||
@@ -155,7 +155,7 @@ public class YTypeAssistContext extends AbstractYamlAssistContext {
|
||||
values = typeUtil.getHintValues(type, getSchemaContext());
|
||||
} catch (Exception e) {
|
||||
DocumentEdits edits = new DocumentEdits(doc.getDocument());
|
||||
return ImmutableList.of(completionFactory().errorMessage(ExceptionUtil.getMessage(e), query, type, edits, typeUtil));
|
||||
return ImmutableList.of(completionFactory().errorMessage(ExceptionUtil.getMessageForUserDisplay(e), query, type, edits, typeUtil));
|
||||
}
|
||||
if (values!=null) {
|
||||
ArrayList<ICompletionProposal> completions = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user