Tweak DSL error formatting
- Add a blank line between the DslFilesException stack trace and formatted error messages. - Quote the sub-function name in the message for UndefinedSubFunction errors.
This commit is contained in:
parent
fbb6cf590d
commit
082f694b1b
@ -41,6 +41,7 @@ public class RulesManager {
|
||||
} catch (IOException | DslFilesException e) {
|
||||
e.printStackTrace();
|
||||
if (e instanceof DslFilesException) {
|
||||
System.err.println();
|
||||
System.err.print(((DslFilesException) e).format());
|
||||
}
|
||||
Engine.getPlatform().exit(1);
|
||||
|
@ -31,7 +31,7 @@ public class DslErrorMessageFormatter implements DslError.Visitor<String> {
|
||||
@Override
|
||||
public String visit(final UndefinedSubFunction undefinedSubFunction) {
|
||||
return String.format(
|
||||
"Sub-function %s is used in a replacement pattern,\nbut not defined in the target pattern",
|
||||
"Sub-function \"%s\" is used in a replacement pattern,\nbut not defined in the target pattern",
|
||||
undefinedSubFunction.getName()
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user