How I can trap FTPPermError ?

R

Raimon Fs

Hello,


I'm trying to access an FTP tp check if the files from database exists
there, and if they have valid size.

Some of them are wrong files with zero kbytes.

My script stops with:

10944/10948 11978 inf_A78028800_12032009153806.pdf VOS200-SAL04

Net::FTPPermError: 550 Can't check for file existence

I want to trap the FTPPermError and continue with other files ...

I've tried with:

FTPPermError
Net::FTPPermError

witha Rescue but the scripts stops and those rescues doesn't fire ...

thanks!

r.


...

begin

size=ftp.size(file_name)
print "File size file: "+size.to_s+"\n"

ftp.getbinaryfile(file_name, file_name_result, 1024)


rescue FTPPermError, NameError => aaaapppppoooooo
return false

rescue Net::FTPPermError, NameError => ooooops
return false


rescue StandardError, NameError => boom
# print "Error while downloading: " + boom
#status=false
return false

end

...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top