Skip to content

Minor fix to error message to match the admin sdk. #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,7 @@ public void fieldPathsMustNotHaveInvalidSegments() {
List<String> badFieldPaths =
asList("foo~bar", "foo*bar", "foo/bar", "foo[1", "foo]1", "foo[1]");
for (String fieldPath : badFieldPaths) {
String reason =
"Invalid field path ("
+ fieldPath
+ "). Paths must not contain '~', '*', '/', '[', or ']'";
verifyFieldPathThrows(fieldPath, reason);
verifyFieldPathThrows(fieldPath, "Use FieldPath.of() for field names containing '~*/[]'.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public static FieldPath documentId() {
static FieldPath fromDotSeparatedPath(@NonNull String path) {
checkNotNull(path, "Provided field path must not be null.");
checkArgument(
!RESERVED.matcher(path).find(),
"Invalid field path (" + path + "). Paths must not contain '~', '*', '/', '[', or ']'");
!RESERVED.matcher(path).find(), "Use FieldPath.of() for field names containing '~*/[]'.");
try {
// By default, split() doesn't return empty leading and trailing segments. This can be enabled
// by passing "-1" as the limit.
Expand Down