title: What's the correct way to return a 'not found' response from a GRPC c++ server implementation?
body: <p>I'm looking through the guides and documentation, but am not deeply familiar with idiomatic C++ programming. In all the server implementation cases I've seen, the response <code>grpc::Status::OK</code> is returned at the end of an RPC implementation, for example:</p>
  
  <p>(from <a href="https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_server.cc" rel="nofollow noreferrer">https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_server.cc</a>)</p>
  
  <pre><code>class GreeterServiceImpl final : public Greeter::Service {
    Status SayHello(ServerContext* context, const HelloRequest* request,
                    HelloReply* reply) override {
      std::string prefix("Hello ");
      reply-&gt;set_message(prefix + request-&gt;name());
      return Status::OK;
    }
  };
  </code></pre>
  
  <p>Is the expected pattern of implementation that Status::OK is <em>always</em> returned? Are there other options that you should return on failure conditions (such as a 404 response to a requested resource not being found)?</p>
  
  <p>Or is it expected that you'll encode the relevant error conditions into your own proto messages, and always reply with a message that possibly contains the error details?</p>
  
  <p>I thought the documentation reflected that there were other status codes that could be returned (NOT_FOUND for example), but when I tried that I'm getting a compilation error:</p>
  
  <p><code>No member named 'NOT_FOUND' in 'grpc::Status'; did you mean 'grpc::NOT_FOUND'?</code></p>
  
  <p>And the method doesn't like it if I'm not returning <code>grpc::NOT_FOUND</code>, as it's an incompatible type. </p>