From ce61de9ae1362a9de895f8fc5a4f63cfcd9ae53e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Nov 2015 11:31:18 +0530 Subject: [PATCH] ... --- src/pyj/book_list/boss.pyj | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pyj/book_list/boss.pyj b/src/pyj/book_list/boss.pyj index a82b327f02..adcbfbb9f0 100644 --- a/src/pyj/book_list/boss.pyj +++ b/src/pyj/book_list/boss.pyj @@ -19,9 +19,13 @@ class Boss: document.title = 'calibre :: ' + self.current_library_name def onerror(self, msg, script_url, line_number, column_number, error_object): - fname = str.rpartition(script_url, '/')[-1] or script_url - msg = msg + '
' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '' - details = '' - if error_object and error_object.stack: - details = error_object.stack - error_dialog(_('Unhandled error'), msg, details) + try: + fname = str.rpartition(script_url, '/')[-1] or script_url + msg = msg + '
' + str.format('Error at {}:{}:{}', fname, line_number, column_number or '') + '' + details = '' + if error_object and error_object.stack: + details = error_object.stack + error_dialog(_('Unhandled error'), msg, details) + return True + except: + console.error('There was an error in the unhandled exception handler')