By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,711 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

Exception Handling

P: n/a
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?

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Have a look at the chapter on exceptions in the python tutorial its pretty good.
http://docs.python.org/tut/node10.html

On 8 Apr 2005 14:29:40 -0700, SuperJared <ja*********@gmail.com> wrote:
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?

--
http://mail.python.org/mailman/listinfo/python-list

--
http://blogs.applibase.net/sidharth
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.