浏览代码

Made ruby server return correct error code for unimplemented method

murgatroid99 10 年之前
父节点
当前提交
3d6d0587bd
共有 1 个文件被更改,包括 3 次插入3 次删除
  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
       nil
     end
     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)
     def found?(an_rpc)
       mth = an_rpc.method.to_sym
       mth = an_rpc.method.to_sym
       return an_rpc if rpc_descs.key?(mth)
       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 }
       noop = proc { |x| x }
       c = ActiveCall.new(an_rpc.call, @cq, noop, noop, an_rpc.deadline)
       c = ActiveCall.new(an_rpc.call, @cq, noop, noop, an_rpc.deadline)
-      c.send_status(StatusCodes::NOT_FOUND, '')
+      c.send_status(StatusCodes::UNIMPLEMENTED, '')
       nil
       nil
     end
     end