incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [23/25] git commit: [#6464] show original url if urlopen fails
Date Wed, 21 Aug 2013 16:06:15 GMT
[#6464] show original url if urlopen fails


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f0d455b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f0d455b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f0d455b0

Branch: refs/heads/master
Commit: f0d455b0dfa6c7d18ee47a0d4535df68d845da5f
Parents: b7dbd2f
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Aug 21 16:00:05 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Aug 21 16:00:05 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/helpers.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f0d455b0/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 39bf250..e68eafb 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -944,8 +944,12 @@ def urlopen(url, retries=3, codes=(408,)):
                 retries -= 1
                 continue
             else:
-                log.exception('Failed after %s retries: %s', retries, e)
-                raise
+                try:
+                    url_string = url.get_full_url()  # if url is Request obj
+                except Exception:
+                    url_string = url
+                log.exception('Failed after %s retries on url: %s: %s', retries, url_string,
e)
+                raise e
 
 
 def plain2markdown(text, preserve_multiple_spaces=False, has_html_entities=False):


Mime
View raw message