title: Error handling in protobuf
body: <p>I am new to protobuf (C++) and try to write first test program with protobuf.
  Code is </p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include "proto/req.pb.h"
  
  using namespace std;
  using namespace google::protobuf;
  
  int main(int argc, char** argv) {
        std::string s = "asdfasdf";
  
          auto MyLogHandler = [] (google::protobuf::LogLevel level, const char* filename, int line, const std::string&amp; message)
          {
              std::cout &lt;&lt; "message " &lt;&lt; message &lt;&lt; std::endl;
          };
          google::protobuf::SetLogHandler(MyLogHandler);
  
          Request req;
          if ( req.ParseFromString(s)){
              cout &lt;&lt; "Parse - OK" &lt;&lt; endl;
          }else{
                 cout &lt;&lt; "Parse - ERROR" &lt;&lt; endl;
          }
          return 0;
      }
  </code></pre>
  
  <p>When program runs - it show only error message, but not any reason about it. How can I get a reason for the error?</p>