# HG changeset patch # User Jeff Hammel # Date 1271192383 25200 # Node ID 4e41e1084e564bc0f6fc8e61d70fe1519ef8d0ac # Parent 292aeb1741f3b0514f4887cfb990e500ab89c3db better exception handling, i hope; i hate lost messages diff -r 292aeb1741f3 -r 4e41e1084e56 bitsyblog/blogme.py --- a/bitsyblog/blogme.py Mon Feb 08 16:29:23 2010 -0500 +++ b/bitsyblog/blogme.py Tue Apr 13 13:59:43 2010 -0700 @@ -139,9 +139,11 @@ connection = urllib2.urlopen(url, data=msg) print connection.url # print the blog post's url break - except urllib2.HTTPError, e: - import pdb; pdb.set_trace() - print e + except (urllib2.HTTPError, urllib2.URLError), e: + continue + else: + print >> sys.stderr, e + print msg if __name__ == '__main__': main()