ProtoBuf throws a FatalException: "*CHECK failed: !coded_out.HadError()*".
It happens "sometimes" when I serialize data using Protobuf.
This is the output that I see on the terminal console of my application:
*[libprotobuf FATAL google/protobuf/message_lite.cc:224] CHECK failed:
!coded_out.HadError(): terminate called after throwing an instance of
'google::protobuf::FatalException' what(): CHECK failed:
!coded_out.HadError(): Press <RETURN> to close this window...*
This is the source code:
*QByteArray ProtobufSerializer::serialize(AbstractTransferable*
transferable) throw(NexusDataLinkException) { ProtoEnvelop envelop;
ProtoPayloadWrapper* wrapper = envelop.add_payloadwrapper();
ChannelResponse* response = static_cast<ChannelResponse*>(transferable);
//Create the response container: ProtoResponse* allocatedProtoResponse =
ProtoResponse::default_instance().New(); populateProtoResponse(response,
allocatedProtoResponse, transferable->getDataContainer()); // Add
payload wrapper for the response: wrapper->set_messagetype(RESPONSE);
wrapper->set_allocated_channelresponse(allocatedProtoResponse);
envelop.set_destination_id(CommonDefinitions::SERVER_ID);
envelop.set_source_id(agentId); // convert to byte array std::string
dataString = envelop.SerializeAsString(); QByteArray data =
QByteArray(dataString.data(), dataString.size()); // makes a deep copy of
the data contained in dataString // prepend 4 bytes package length
prefix to binary package ProtobufUtil::prependEnvelopSize(data);
return data;}*
What does the error message mean? Can anybody help me please?
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.