Skip to content

Commit aab7026

Browse files
authored
Update error messages to match Rust and Java implementations (#338)
## Usage and product changes We fixed various logical and grammatical issues in the Java and Rust error messages, aiming to have similar errors from both implementations. ## Implementation * Add missing error messages update initiated in 99bb587 for one of the languages. * Update error message for valid labels format, broadening the leading character restrictions.
1 parent cc42164 commit aab7026

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

java/common/exception/ErrorMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class ErrorMessage extends com.vaticle.typedb.common.exception.ErrorMessa
8989
public static final ErrorMessage ILLEGAL_GRAMMAR =
9090
new ErrorMessage(41, "Illegal grammar: '%s'");
9191
public static final ErrorMessage INVALID_TYPE_LABEL =
92-
new ErrorMessage(42, "The type label '%s' is invalid. Type labels must be valid Unicode identifiers.");
92+
new ErrorMessage(42, "The type label '%s' is invalid. Type labels must be valid Unicode identifiers with restrictions on the leading character.");
9393
public static final ErrorMessage INVALID_ANNOTATION =
9494
new ErrorMessage(43, "Invalid annotation '%s' on '%s' constraint");
9595

rust/common/error/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ error_messages! { TypeQLError
9393
MatchHasNoBoundingNamedVariable =
9494
7: "The match query does not have named variables to bound the nested disjunction/negation pattern(s).",
9595
VariableNameConflict { names: String } =
96-
8: "The variable names {names} cannot be used for both concept variables and value variables.",
96+
8: "The variable(s) named {names} cannot be used for both a concept variable and a value variable.",
9797
MatchStatementHasNoNamedVariable { pattern: Pattern } =
9898
9: "The statement '{pattern}' has no named variable.",
9999
MatchHasUnboundedNestedPattern { pattern: Pattern } =
@@ -129,7 +129,7 @@ error_messages! { TypeQLError
129129
InvalidConstraintDatetimePrecision { date_time: NaiveDateTime } =
130130
25: "Attempted to assign DateTime value of '{date_time}' which is more precise than 1 millisecond.",
131131
InvalidDefineQueryVariable =
132-
26: "Invalid define/undefine query. User defined variables are not accepted in a define/undefine query.",
132+
26: "Invalid define/undefine query. User-defined variables are not accepted in a define/undefine query.",
133133
InvalidUndefineQueryRule { rule_label: Label } =
134134
27: "Invalid undefine query: the rule body of '{rule_label}' ('when' or 'then') cannot be undefined. The rule must be undefined entirely by referring to its label.",
135135
InvalidRuleWhenMissingPatterns { rule_label: Label } =
@@ -153,5 +153,5 @@ error_messages! { TypeQLError
153153
IllegalGrammar { input: String } =
154154
37: "Illegal grammar: '{input}'",
155155
InvalidTypeLabel { label: String } =
156-
38: "The type label '{label}' is invalid. Type labels must be valid utf-8 identifiers without a leading underscore.",
156+
38: "The type label '{label}' is invalid. Type labels must be valid Unicode identifiers with restrictions on the leading character.",
157157
}

0 commit comments

Comments
 (0)