From: nobu.nokada@... Date: 2002-04-04T15:19:10+09:00 Subject: Re: Processing Net module errors Hi, At Thu, 4 Apr 2002 12:30:55 +0900, Viktor Eydel wrote: > Either nobody understood the question or it was really too stupid... > Probably the last one! I fixed it up, sorry for bothering you guys. Just you are too impatience. > > Looks like in case of all different kinds of network failures, such as > > interface not up, cable unplugged, unknown host name, etc., ruby > > returns SocketError on open_socket call (as it probably should), > > raises some kind of exception and terminates my script. I looked at > > module Net but didn't find anything better then FTPProtoError and the > > like. Which exception do I need to intercept in my rescue clause for > > all sorts of socket failures? I am a kinda new to Ruby, and I > > apologize if I overlooked something very primitive. begin ftp = FTP.new(host) rescue SocketError, FTPError # intercept end or, the bellow returns nil at any standard errors. (FTP.new(host) rescue nil) -- Nobu Nakada