mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Also log unhandled errors to the console
This commit is contained in:
parent
5372b390d7
commit
887c92ad6f
@ -66,6 +66,7 @@ class Boss:
|
|||||||
document.title = self.read_ui.current_metadata.title
|
document.title = self.read_ui.current_metadata.title
|
||||||
|
|
||||||
def onerror(self, msg, script_url, line_number, column_number, error_object):
|
def onerror(self, msg, script_url, line_number, column_number, error_object):
|
||||||
|
console.log(error_object)
|
||||||
try:
|
try:
|
||||||
fname = str.rpartition(script_url, '/')[-1] or script_url
|
fname = str.rpartition(script_url, '/')[-1] or script_url
|
||||||
msg = msg + '<br><span style="font-size:smaller">' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '</span>'
|
msg = msg + '<br><span style="font-size:smaller">' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '</span>'
|
||||||
@ -75,7 +76,7 @@ class Boss:
|
|||||||
error_dialog(_('Unhandled error'), msg, details)
|
error_dialog(_('Unhandled error'), msg, details)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
console.error('There was an error in the unhandled exception handler')
|
console.log('There was an error in the unhandled exception handler')
|
||||||
|
|
||||||
def onpopstate(self, ev):
|
def onpopstate(self, ev):
|
||||||
data = parse_url_params()
|
data = parse_url_params()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user