On Thursday, January 31, 2013 4:07:55 AM UTC+8, Naoum wrote:
>
> Hi,
>
> I am constructing a message on a client using the generated setter methods 
> for the GPB class and sending it over the network to my server. On the 
> server side, however, the message fails to parse and ParseFromString() 
> returns false. Any tips on how to debug parsing failure errors?
>
You can try to use ParsePartialFromString() and see if it succeeds. If it 
does, then you are missing some required fields in your proto. If it 
doesn't, it means the data is corrupted somehow. A probable cause is that 
the data stream is trimmed.
 

>
> I've actually traced this to only happen when an optional double value is 
> present in the message. Any ideas why that might be? The following class is 
> nested several levels inside my msg and when it only has a stringValue it 
> works fine, but when it has a doubleValue it fails to parse. Any thoughts? 
> I will try it again without the nesting but am wondering what could be 
> causing this.
>
>   message Field {
>     required string name = 1;
>     optional double doubleValue = 2;
>     optional string stringValue = 3;
>   }
>
>
> Thanks,
> N
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to