C
christoph.heindl
Hi,
since i started network programming in ruby i wondered about the
differnt kind of errors raised. On the one site we have the SocketError
object, on the other site a multiplicity of Errno may occur
(Errno::ECONNREFUSED, Errno::EHOSTUNREACH, etc.)
This becomes quite inconvient to handle as my rescue block looks like
this:
rescue IOError, Errno::ECONNREFUSED, Errno::ECONNRESET,
Errno::ETIMEDOUT,
Errno::ENETUNREACH, Errno::ENOTSOCK, Errno::EHOSTUNREACH, SocketError
=> err
I still don't know if i catch all of them. Isn't there a more convient
way of catching just errors which might happen on TCPSocket?
regards,
christoph
since i started network programming in ruby i wondered about the
differnt kind of errors raised. On the one site we have the SocketError
object, on the other site a multiplicity of Errno may occur
(Errno::ECONNREFUSED, Errno::EHOSTUNREACH, etc.)
This becomes quite inconvient to handle as my rescue block looks like
this:
rescue IOError, Errno::ECONNREFUSED, Errno::ECONNRESET,
Errno::ETIMEDOUT,
Errno::ENETUNREACH, Errno::ENOTSOCK, Errno::EHOSTUNREACH, SocketError
=> err
I still don't know if i catch all of them. Isn't there a more convient
way of catching just errors which might happen on TCPSocket?
regards,
christoph