This commit is contained in:
Kovid Goyal 2015-11-12 11:31:18 +05:30
parent 5a7dd0d331
commit ce61de9ae1

View File

@ -19,9 +19,13 @@ class Boss:
document.title = 'calibre :: ' + self.current_library_name document.title = 'calibre :: ' + self.current_library_name
def onerror(self, msg, script_url, line_number, column_number, error_object): def onerror(self, msg, script_url, line_number, column_number, error_object):
fname = str.rpartition(script_url, '/')[-1] or script_url try:
msg = msg + '<br><span style="font-size:smaller">' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '</span>' fname = str.rpartition(script_url, '/')[-1] or script_url
details = '' msg = msg + '<br><span style="font-size:smaller">' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '</span>'
if error_object and error_object.stack: details = ''
details = error_object.stack if error_object and error_object.stack:
error_dialog(_('Unhandled error'), msg, details) details = error_object.stack
error_dialog(_('Unhandled error'), msg, details)
return True
except:
console.error('There was an error in the unhandled exception handler')