Jelajahi Sumber

Made ruby server return correct error code for unimplemented method

murgatroid99 10 tahun lalu
induk
melakukan
3d6d0587bd
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      src/ruby/lib/grpc/generic/rpc_server.rb

+ 3 - 3
src/ruby/lib/grpc/generic/rpc_server.rb

@@ -398,14 +398,14 @@ module GRPC
       nil
     end
 
-    # Sends NOT_FOUND if the method can't be found
+    # Sends UNIMPLEMENTED if the method is not implemented by this server
     def found?(an_rpc)
       mth = an_rpc.method.to_sym
       return an_rpc if rpc_descs.key?(mth)
-      GRPC.logger.warn("NOT_FOUND: #{an_rpc}")
+      GRPC.logger.warn("UNIMPLEMENTED: #{an_rpc}")
       noop = proc { |x| x }
       c = ActiveCall.new(an_rpc.call, @cq, noop, noop, an_rpc.deadline)
-      c.send_status(StatusCodes::NOT_FOUND, '')
+      c.send_status(StatusCodes::UNIMPLEMENTED, '')
       nil
     end