diff options
author | Andrew Dolgov <[email protected]> | 2013-04-20 10:43:21 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-20 10:43:21 +0400 |
commit | f66492d357010a2e5ec11e07fd6db9825184d37d (patch) | |
tree | cc16477ba7f3af089d88255a9d2912f345059561 /js/functions.js | |
parent | 9ce600c8018b6cfe7711f28fa46247f62f424379 (diff) |
better javascript error reporting, save error reports in tt-rss log
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/js/functions.js b/js/functions.js index 04be58bf7..8442e1c9f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -50,6 +50,21 @@ function exception_error(location, e, ext_info) { } } + try { + new Ajax.Request("backend.php", { + parameters: {op: "rpc", method: "log", logmsg: msg}, + onComplete: function (transport) { + console.log(transport.responseText); + } }); + + } catch (eii) { + console.log("Exception while trying to log the error."); + console.log(eii); + } + + msg += "<p>"+ __("The error will be reported to the configured log destination.") + + "</p>"; + var content = "<div class=\"fatalError\">" + "<pre>" + msg + "</pre>"; @@ -106,7 +121,28 @@ function exception_error(location, e, ext_info) { dialog.show(); - } catch (e) { + } catch (ei) { + console.log("Exception while trying to report an exception. Oh boy."); + console.log(ei); + console.log("Original exception:"); + console.log(e); + + msg += "\n\nAdditional exception caught while trying to show the error dialog.\n\n" + format_exception_error('exception_error', ei); + + try { + new Ajax.Request("backend.php", { + parameters: {op: "rpc", method: "log", logmsg: msg}, + onComplete: function (transport) { + console.log(transport.responseText); + } }); + + } catch (eii) { + console.log("Third exception while trying to log the error! Seriously?"); + console.log(eii); + } + + msg += "\n\nThe error will be reported to the configured log destination."; + alert(msg); } |