aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/internal/field_mask_utility.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-08-22 18:25:48 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-08-22 18:25:48 -0700
commiteee38b0c018b3279f77d03dff796f440f40d3516 (patch)
tree7ff0978e30238d493fc7899b75abeb6d66939f07 /src/google/protobuf/util/internal/field_mask_utility.cc
parentc3bc155aceda36ecb01cde2367a3b427f2d7ce40 (diff)
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/util/internal/field_mask_utility.cc')
-rw-r--r--src/google/protobuf/util/internal/field_mask_utility.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/google/protobuf/util/internal/field_mask_utility.cc b/src/google/protobuf/util/internal/field_mask_utility.cc
index 92468959..f0e8fc88 100644
--- a/src/google/protobuf/util/internal/field_mask_utility.cc
+++ b/src/google/protobuf/util/internal/field_mask_utility.cc
@@ -34,7 +34,6 @@
#include <google/protobuf/stubs/status_macros.h>
namespace google {
-
namespace protobuf {
namespace util {
namespace converter {
@@ -138,7 +137,7 @@ util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
}
// Un-escaped '"' must be followed with a ']'.
if (i >= length - 1 || paths[i + 1] != ']') {
- return CreatePublicError(
+ return util::Status(
util::error::INVALID_ARGUMENT,
StrCat("Invalid FieldMask '", paths,
"'. Map keys should be represented as [\"some_key\"]."));
@@ -150,7 +149,7 @@ util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
// Checks whether the key ends at the end of a path segment.
if (i < length - 1 && paths[i + 1] != '.' && paths[i + 1] != ',' &&
paths[i + 1] != ')' && paths[i + 1] != '(') {
- return CreatePublicError(
+ return util::Status(
util::error::INVALID_ARGUMENT,
StrCat("Invalid FieldMask '", paths,
"'. Map keys should be at the end of a path segment."));
@@ -162,7 +161,7 @@ util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
// We are not in a map key, look for the start of one.
if (paths[i] == '[') {
if (i >= length - 1 || paths[i + 1] != '\"') {
- return CreatePublicError(
+ return util::Status(
util::error::INVALID_ARGUMENT,
StrCat("Invalid FieldMask '", paths,
"'. Map keys should be represented as [\"some_key\"]."));
@@ -198,7 +197,7 @@ util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
// Removes the last prefix after seeing a ')'.
if (i < length && paths[i] == ')') {
if (prefix.empty()) {
- return CreatePublicError(
+ return util::Status(
util::error::INVALID_ARGUMENT,
StrCat("Invalid FieldMask '", paths,
"'. Cannot find matching '(' for all ')'."));
@@ -208,16 +207,14 @@ util::Status DecodeCompactFieldMaskPaths(StringPiece paths,
previous_position = i + 1;
}
if (in_map_key) {
- return CreatePublicError(
- util::error::INVALID_ARGUMENT,
- StrCat("Invalid FieldMask '", paths,
- "'. Cannot find matching ']' for all '['."));
+ return util::Status(util::error::INVALID_ARGUMENT,
+ StrCat("Invalid FieldMask '", paths,
+ "'. Cannot find matching ']' for all '['."));
}
if (!prefix.empty()) {
- return CreatePublicError(
- util::error::INVALID_ARGUMENT,
- StrCat("Invalid FieldMask '", paths,
- "'. Cannot find matching ')' for all '('."));
+ return util::Status(util::error::INVALID_ARGUMENT,
+ StrCat("Invalid FieldMask '", paths,
+ "'. Cannot find matching ')' for all '('."));
}
return util::Status::OK;
}