diff options
author | Rob Austein <sra@hactrn.net> | 2010-11-18 14:22:14 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-11-18 14:22:14 +0000 |
commit | 4883b7e3e7147526a13b6adca85bed451ece63b1 (patch) | |
tree | 48011b3b93c779259cb78bb4ced26e524816647a /scripts | |
parent | 36edfc2121960ef27cbc75508fa857aa0a0ef542 (diff) |
Log URL when failing
svn path=/scripts/rpkidemo; revision=3557
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/rpkidemo | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/rpkidemo b/scripts/rpkidemo index 4c4cbac0..f02b1cc3 100755 --- a/scripts/rpkidemo +++ b/scripts/rpkidemo @@ -320,9 +320,13 @@ class main(object): url = "%s%s/%s" % (self.myrpki_url, url, self.username) data = open(filename).read() print "Uploading", filename, "to", url - return self.opener.open(urllib2.Request(url, data, { - "Content-Type" : content_type, - "User-Agent" : self.user_agent })) + try: + return self.opener.open(urllib2.Request(url, data, { + "Content-Type" : content_type, + "User-Agent" : self.user_agent })) + except urllib2.HTTPError: + sys.stderr.write("Problem uploading to URL %s\n" % url) + raise def update(self): """ @@ -361,6 +365,7 @@ class main(object): if e.code == 304: # 304 == "Not Modified" return False else: + sys.stderr.write("Problem polling URL %s\n" % url) raise def poll_loop(self): |