diff bitsyblog/blogme.py @ 65:4e41e1084e56

better exception handling, i hope; i hate lost messages
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 13 Apr 2010 13:59:43 -0700
parents 04866e5abb5a
children 894a2e76bd40
line wrap: on
line diff
--- 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()