Ruby xml rpc error handilng

Posted by stel on Stack Overflow See other posts from Stack Overflow or by stel
Published on 2010-05-03T19:01:32Z Indexed on 2010/05/03 22:08 UTC
Read the original article Hit count: 157

Filed under:

I have a model


class Car
  @@RPCServer = XMLRPC::Client.new("localhost", "/", 8080)

  def self.count
    @@RPCServer.call("cars.count")
  end
end

If server is not running on localhost:8080 I've got a Errno::ECONNREFUSED error.
I want to display an error message to user, how can a handle this error?

© Stack Overflow or respective owner

Related posts about ruby-on-rails