Skip to content

Commit 84e9618

Browse files
committed
Improve error messages
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 83ea561 commit 84e9618

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/compiler/src/main/java/config/parser/ConfigAstBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ private Statement assignment(AssignmentStatementContext ctx) {
518518
if ( isAssignmentLhsValid(left) )
519519
return stmt(ast( binX(left, token(ctx.op), expression(ctx.right)), ctx ));
520520

521-
throw createParsingFailedException("Invalid assignment target -- should be a variable, index, or property expression", ctx);
521+
throw createParsingFailedException("Invalid assignment target -- must be a variable, index, or property expression", ctx);
522522
}
523523

524524
private boolean isAssignmentLhsValid(Expression left) {

modules/compiler/src/main/java/script/parser/ScriptAstBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ private FeatureFlagNode featureFlagDeclaration(FeatureFlagDeclarationContext ctx
321321
var value = expression(ctx.expression());
322322
var result = ast( new FeatureFlagNode(name, value), ctx );
323323
if( !(value instanceof ConstantExpression) )
324-
collectSyntaxError(new SyntaxException("Feature flag value should be a literal value (number, string, true/false)", result));
324+
collectSyntaxError(new SyntaxException("Feature flag value must be a literal value (number, string, true/false)", result));
325325
return result;
326326
}
327327

@@ -570,7 +570,7 @@ private Statement workflowEmits(WorkflowEmitsContext ctx) {
570570
private Statement workflowEmit(StatementContext ctx) {
571571
var result = statement(ctx);
572572
if( !(result instanceof ExpressionStatement) ) {
573-
collectSyntaxError(new SyntaxException("Invalid workflow emit -- should be a name, assignment, or expression", result));
573+
collectSyntaxError(new SyntaxException("Invalid workflow emit -- must be a name, assignment, or expression", result));
574574
return null;
575575
}
576576
saveTrailingComment(result, ctx);
@@ -845,7 +845,7 @@ private Statement assignment(AssignmentStatementContext ctx) {
845845
if ( isAssignmentLhsValid(left) )
846846
return stmt(ast( new AssignmentExpression(left, token(ctx.op), expression(ctx.right)), ctx ));
847847

848-
throw createParsingFailedException("Invalid assignment target -- should be a variable, index, or property expression", ctx);
848+
throw createParsingFailedException("Invalid assignment target -- must be a variable, index, or property expression", ctx);
849849
}
850850

851851
private boolean isAssignmentLhsValid(Expression left) {

0 commit comments

Comments
 (0)