You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/08/21 19:35:06 UTC

[23/26] git commit: [#6464] show original url if urlopen fails

[#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/cj/6580
Commit: f0d455b0dfa6c7d18ee47a0d4535df68d845da5f
Parents: b7dbd2f
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 21 16:00:05 2013 +0000
Committer: Dave Brondsema <db...@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):