27
27
28
28
namespace pbutil = ::google::protobuf::util;
29
29
namespace pbconv = ::google::protobuf::util::converter;
30
- namespace pberr = ::google::protobuf::util::error;
31
30
32
31
namespace google {
33
32
namespace grpc {
@@ -63,7 +62,7 @@ class SimpleTypeResolver : public pbutil::TypeResolver {
63
62
}
64
63
return pbutil::Status ();
65
64
} else {
66
- return pbutil::Status (pberr::NOT_FOUND ,
65
+ return pbutil::Status (pbutil::StatusCode:: kNotFound ,
67
66
" Type '" + type_url + " ' cannot be found." );
68
67
}
69
68
}
@@ -78,7 +77,7 @@ class SimpleTypeResolver : public pbutil::TypeResolver {
78
77
}
79
78
return pbutil::Status ();
80
79
} else {
81
- return pbutil::Status (pberr::NOT_FOUND ,
80
+ return pbutil::Status (pbutil::StatusCode:: kNotFound ,
82
81
" Enum '" + type_url + " ' cannot be found." );
83
82
}
84
83
}
@@ -159,7 +158,7 @@ pbutil::Status TypeHelper::ResolveFieldPath(
159
158
// Find the field by name in the current type
160
159
auto field = Info ()->FindField (current_type, field_names[i]);
161
160
if (nullptr == field) {
162
- return pbutil::Status (pberr::INVALID_ARGUMENT ,
161
+ return pbutil::Status (pbutil::StatusCode:: kInvalidArgument ,
163
162
" Could not find field \" " + field_names[i] +
164
163
" \" in the type \" " + current_type->name () +
165
164
" \" ." );
@@ -170,22 +169,22 @@ pbutil::Status TypeHelper::ResolveFieldPath(
170
169
// If this is not the last field in the path, it must be a message
171
170
if (google::protobuf::Field::TYPE_MESSAGE != field->kind ()) {
172
171
return pbutil::Status (
173
- pberr::INVALID_ARGUMENT ,
172
+ pbutil::StatusCode:: kInvalidArgument ,
174
173
" Encountered a non-leaf field \" " + field->name () +
175
174
" \" that is not a message while parsing a field path" );
176
175
}
177
176
178
177
// Update the type of the current message
179
178
current_type = Info ()->GetTypeByTypeUrl (field->type_url ());
180
179
if (nullptr == current_type) {
181
- return pbutil::Status (pberr::INVALID_ARGUMENT ,
180
+ return pbutil::Status (pbutil::StatusCode:: kInvalidArgument ,
182
181
" Cannot find the type \" " + field->type_url () +
183
182
" \" while parsing a field path." );
184
183
}
185
184
}
186
185
}
187
186
*field_path_out = std::move (field_path);
188
- return pbutil::Status::OK ;
187
+ return pbutil::Status () ;
189
188
}
190
189
191
190
} // namespace transcoding
0 commit comments