From d7ceb3dd2330f34f0304f6997a8ca917c72c0b4f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Oct 2015 16:44:18 +0530 Subject: [PATCH] Show request path when failing to load library data --- src/pyj/ajax.pyj | 1 + src/pyj/srv.pyj | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj index 16f054c9da..a1e4586cd9 100644 --- a/src/pyj/ajax.pyj +++ b/src/pyj/ajax.pyj @@ -5,6 +5,7 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET'): xhr = XMLHttpRequest() if bypass_cache: path += ('&' if '?' in path else '?') + Date().getTime() + xhr.request_path = path def progress_callback(ev): if ev.lengthComputable: diff --git a/src/pyj/srv.pyj b/src/pyj/srv.pyj index e64be635f4..523254781c 100644 --- a/src/pyj/srv.pyj +++ b/src/pyj/srv.pyj @@ -12,9 +12,9 @@ def on_library_loaded(end_type, xhr, ev): data = xhr.response data else: - document.body.appendChild(E.p(style="color:red", _( - 'Failed to download library data, with status:') + str.format(' [{}] {}', xhr.status, xhr.statusText) - )) + document.body.appendChild(E.p(style="color:red", str.format(_( + 'Failed to download library data from "{}", with status: [{}] {}'), + xhr.request_path, xhr.status, xhr.statusText))) def on_library_load_progress(loaded, total): p = document.querySelector('#page_load_progress > progress')