Improving some error marker messages

This commit is contained in:
Kris De Volder
2017-01-24 19:07:37 -08:00
parent 3689bdb6f5
commit caa554d288
17 changed files with 74 additions and 17 deletions

View File

@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -10,13 +10,15 @@
*******************************************************************************/
package org.springframework.ide.vscode.commons.languageserver.reconcile;
import org.springframework.ide.vscode.commons.util.ValueParseException;
/**
* Exception if there is a failure when parsing a value. It does not wrap
* other exceptions such that when thrown, the parse exception is the "deepest"
* error.
*
*/
public class ReconcileException extends Exception implements ProblemTypeProvider {
public class ReconcileException extends ValueParseException implements ProblemTypeProvider {
private static final long serialVersionUID = 1L;
private final ProblemType problemType;

View File

@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -32,6 +32,7 @@ import org.springframework.ide.vscode.commons.util.ExceptionUtil;
import org.springframework.ide.vscode.commons.util.IntegerRange;
import org.springframework.ide.vscode.commons.util.Log;
import org.springframework.ide.vscode.commons.util.StringUtil;
import org.springframework.ide.vscode.commons.util.ValueParseException;
import org.springframework.ide.vscode.commons.util.ValueParser;
import org.springframework.ide.vscode.commons.util.text.IDocument;
import org.springframework.ide.vscode.commons.yaml.ast.NodeUtil;
@@ -194,7 +195,7 @@ public class SchemaBasedYamlASTReconciler implements YamlASTReconciler {
Throwable e = ExceptionUtil.getDeepestCause(_e);
// If value parse exception, do not append any additional information
if (e instanceof ReconcileException) {
if (e instanceof ValueParseException) {
String msg = e.getMessage();
if (StringUtil.hasText(msg)) {
return msg;