changeset 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 292aeb1741f3
children 0f25fe665367 894a2e76bd40
files bitsyblog/blogme.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
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()