[
https://issues.apache.org/jira/browse/MESOS-1194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14359142#comment-14359142
]
Akanksha Agrawal edited comment on MESOS-1194 at 3/13/15 7:34 PM:
------------------------------------------------------------------
Added the required validatiion in the constructor:
if (!message.IsInitialized()) {
std::cerr << "Protobuf not initialized: " <<
message.InitializationErrorString() << std::endl;
abort();
}
was (Author: akanksha08):
In if (!message.IsInitialized()) {
Changed
return Error(message.InitializationErrorString() +
" is required but not initialized");
to
std::cerr << "Protobuf not initialized: " <<
message.InitializationErrorString() << std::endl;
abort();
}
in protobuf.hpp
> protobuf-JSON rendering doesnt validate
> ---------------------------------------
>
> Key: MESOS-1194
> URL: https://issues.apache.org/jira/browse/MESOS-1194
> Project: Mesos
> Issue Type: Bug
> Components: stout
> Affects Versions: 0.19.0
> Reporter: Till Toenshoff
> Assignee: Akanksha Agrawal
> Priority: Minor
> Labels: json, newbie, protobuf, stout
>
> When using JSON::Protobuf(Message&), the supplied protobuf is not checked for
> being properly initialized, hence e.g. required fields could be missing.
> It would be desirable to have a feedback mechanism in place for this
> constructor - maybe this would do:
> {noformat}
> if (!message.IsInitialized()) {
> std::cerr << "Protobuf not initialized: " <<
> message.InitializationErrorString() << std::endl;
> abort();
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)