Made ruby server return correct error code for unimplemented method

pull/2336/head
murgatroid99 10 years ago
parent 443f58e37b
commit 3d6d0587bd
  1. 6
      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

Loading…
Cancel
Save