mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show request path when failing to load library data
This commit is contained in:
parent
485c2d8af1
commit
d7ceb3dd23
@ -5,6 +5,7 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET'):
|
|||||||
xhr = XMLHttpRequest()
|
xhr = XMLHttpRequest()
|
||||||
if bypass_cache:
|
if bypass_cache:
|
||||||
path += ('&' if '?' in path else '?') + Date().getTime()
|
path += ('&' if '?' in path else '?') + Date().getTime()
|
||||||
|
xhr.request_path = path
|
||||||
|
|
||||||
def progress_callback(ev):
|
def progress_callback(ev):
|
||||||
if ev.lengthComputable:
|
if ev.lengthComputable:
|
||||||
|
@ -12,9 +12,9 @@ def on_library_loaded(end_type, xhr, ev):
|
|||||||
data = xhr.response
|
data = xhr.response
|
||||||
data
|
data
|
||||||
else:
|
else:
|
||||||
document.body.appendChild(E.p(style="color:red", _(
|
document.body.appendChild(E.p(style="color:red", str.format(_(
|
||||||
'Failed to download library data, with status:') + str.format(' [{}] {}', xhr.status, xhr.statusText)
|
'Failed to download library data from "{}", with status: [{}] {}'),
|
||||||
))
|
xhr.request_path, xhr.status, xhr.statusText)))
|
||||||
|
|
||||||
def on_library_load_progress(loaded, total):
|
def on_library_load_progress(loaded, total):
|
||||||
p = document.querySelector('#page_load_progress > progress')
|
p = document.querySelector('#page_load_progress > progress')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user