Exception Handling

S

SuperJared

I'm new to Python, well versed in PHP and a bit of Perl.

I've written a simple backup utility that FTPs from one server to
another. I'd like to implement exception handling on the FTP should
someting go wrong.

This is basically what I have so far:


try:
ftp = FTP(ftp_host, ftp_user, ftp_pass)
ftp.storbinary('STOR ' + filename, pointer)
ftp.close()
except:
# do something with an error message here...?


I'd like to use 'all_errors' but I don't know how! Will I have to
create a handler for each other exception?
 

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

No members online now.

Forum statistics

Threads
474,234
Messages
2,571,178
Members
47,809
Latest member
Adisty

Latest Threads

Top