Adding simple error checking clause in protobuf generation.