From: Greg Hewgill Date: Thu, 27 Aug 2009 07:41:25 +0000 (+1200) Subject: additional information on fetch exception X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fljdump.git;a=commitdiff_plain;h=d74f21258be16d732c4c864db591168eee9481ab additional information on fetch exception --- diff --git a/ljdump.py b/ljdump.py index f6820af..a6326ba 100755 --- a/ljdump.py +++ b/ljdump.py @@ -244,8 +244,9 @@ def ljdump(Server, Username, Password, Journal): try: r = urllib2.urlopen(urllib2.Request(Server+"/export_comments.bml?get=comment_meta&startid=%d%s" % (maxid+1, authas), headers = {'Cookie': "ljsession="+ljsession})) meta = xml.dom.minidom.parse(r) - except: + except Exception, x: print "*** Error fetching comment meta, possibly not community maintainer?" + print "***", x break finally: try: @@ -280,8 +281,9 @@ def ljdump(Server, Username, Password, Journal): try: r = urllib2.urlopen(urllib2.Request(Server+"/export_comments.bml?get=comment_body&startid=%d%s" % (maxid+1, authas), headers = {'Cookie': "ljsession="+ljsession})) meta = xml.dom.minidom.parse(r) - except: + except Exception, x: print "*** Error fetching comment body, possibly not community maintainer?" + print "***", x break finally: r.close()