2727
2828namespace pbutil = ::google::protobuf::util;
2929namespace pbconv = ::google::protobuf::util::converter;
30- namespace pberr = ::google::protobuf::util::error;
3130
3231namespace google {
3332namespace grpc {
@@ -63,7 +62,7 @@ class SimpleTypeResolver : public pbutil::TypeResolver {
6362 }
6463 return pbutil::Status ();
6564 } else {
66- return pbutil::Status (pberr::NOT_FOUND ,
65+ return pbutil::Status (pbutil::StatusCode:: kNotFound ,
6766 " Type '" + type_url + " ' cannot be found." );
6867 }
6968 }
@@ -78,7 +77,7 @@ class SimpleTypeResolver : public pbutil::TypeResolver {
7877 }
7978 return pbutil::Status ();
8079 } else {
81- return pbutil::Status (pberr::NOT_FOUND ,
80+ return pbutil::Status (pbutil::StatusCode:: kNotFound ,
8281 " Enum '" + type_url + " ' cannot be found." );
8382 }
8483 }
@@ -159,7 +158,7 @@ pbutil::Status TypeHelper::ResolveFieldPath(
159158 // Find the field by name in the current type
160159 auto field = Info ()->FindField (current_type, field_names[i]);
161160 if (nullptr == field) {
162- return pbutil::Status (pberr::INVALID_ARGUMENT ,
161+ return pbutil::Status (pbutil::StatusCode:: kInvalidArgument ,
163162 " Could not find field \" " + field_names[i] +
164163 " \" in the type \" " + current_type->name () +
165164 " \" ." );
@@ -170,22 +169,22 @@ pbutil::Status TypeHelper::ResolveFieldPath(
170169 // If this is not the last field in the path, it must be a message
171170 if (google::protobuf::Field::TYPE_MESSAGE != field->kind ()) {
172171 return pbutil::Status (
173- pberr::INVALID_ARGUMENT ,
172+ pbutil::StatusCode:: kInvalidArgument ,
174173 " Encountered a non-leaf field \" " + field->name () +
175174 " \" that is not a message while parsing a field path" );
176175 }
177176
178177 // Update the type of the current message
179178 current_type = Info ()->GetTypeByTypeUrl (field->type_url ());
180179 if (nullptr == current_type) {
181- return pbutil::Status (pberr::INVALID_ARGUMENT ,
180+ return pbutil::Status (pbutil::StatusCode:: kInvalidArgument ,
182181 " Cannot find the type \" " + field->type_url () +
183182 " \" while parsing a field path." );
184183 }
185184 }
186185 }
187186 *field_path_out = std::move (field_path);
188- return pbutil::Status::OK ;
187+ return pbutil::Status () ;
189188}
190189
191190} // namespace transcoding
0 commit comments