Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to avoid: Warning: Required field not set while parsing. This is an error. #6

Open
GoogleCodeExporter opened this issue Jul 13, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

running the code sample gives:
Warning: Required field not set while parsing. This is an error. 
upon the 1st call with an empty buffer 

bob = pb_read_Person();

The field is later set. Ideally, the warning shouldn't be there during the 
initial empty construction of bob. Instead there should be a final check on the 
constructed object that checks all required fields are set (could be 
recursive). And then one can throw error instead of warning. 
That should work right?




Original issue reported on code.google.com by [email protected] on 17 Jan 2013 at 5:55

@GoogleCodeExporter
Copy link
Author

I agree that this warning is useless when you're creating a new message. I also 
agree that an error should be thrown if a required field remains unset during 
encoding. The two attached m-files can be dropped into 
"protobuf-matlab/protobuflib/" to achieve the desired behavior.

Original comment by [email protected] on 16 Oct 2013 at 7:56

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant