mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:23:43 +02:00
Fix exception when trying to read ajax responsetext in error handler
This commit is contained in:
parent
ecb302fa04
commit
473bff43e3
1 changed files with 4 additions and 1 deletions
|
|
@ -77,7 +77,10 @@ def set_error(event, is_network_error):
|
|||
elif event is 'abort':
|
||||
xhr.error_html = str.format(_('Failed to communicate with "{}", aborted'), xhr.request_path)
|
||||
else:
|
||||
rtext = xhr.responseText or ''
|
||||
try:
|
||||
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])
|
||||
|
||||
def progress_callback(ev):
|
||||
|
|
|
|||
Loading…
Reference in a new issue