Better error message on AJAX call failure

This commit is contained in:
Kovid Goyal 2019-11-02 07:18:35 +05:30
parent e73f7da330
commit 8b7b9427bd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -81,7 +81,7 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', q
rtext = xhr.responseText or ''
except:
rtext = ''
xhr.error_html = str.format(_('Failed to communicate with "{}", with status: [{}] {}<br><br>{}'), xhr.request_path, xhr.status, xhr.statusText, rtext[:200])
xhr.error_html = str.format(_('Failed to communicate with "{}", with status: [{} ({})] {}<br><br>{}'), xhr.request_path, xhr.status, event, xhr.statusText, rtext[:200])
def progress_callback(ev):
if ev.lengthComputable: