summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-03-06 10:56:08 +0300
committerAndrew Dolgov <[email protected]>2011-03-06 10:56:08 +0300
commitba083651fa57c7bd19358701b0da17c354bcd564 (patch)
treea17ff43e4a90664fee606cd87c931e6933ece8ea /functions.js
parentce68ec747ad803b9973aecec9653399668422428 (diff)
add code to report fatal exceptions to tt-rss.org
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/functions.js b/functions.js
index 88365d70a..423b0b539 100644
--- a/functions.js
+++ b/functions.js
@@ -43,11 +43,40 @@ function exception_error(location, e, ext_info) {
content += "</div>";
- // TODO: add code to automatically report errors to tt-rss.org
+ content += "<div class='dlgButtons'>";
+
+ content += "<button dojoType=\"dijit.form.Button\""+
+ "onclick=\"dijit.byId('exceptionDlg').report()\">" +
+ __('Report to tt-rss.org') + "</button> ";
+ content += "<button dojoType=\"dijit.form.Button\" "+
+ "onclick=\"dijit.byId('exceptionDlg').hide()\">" +
+ __('Close') + "</button>";
+ content += "</div>";
+
var dialog = new dijit.Dialog({
+ id: "exceptionDlg",
title: "Unhandled exception",
style: "width: 600px",
+ report: function() {
+ if (confirm(__("Are you sure to report this exception to tt-rss.org? The report will include your browser information. Your IP would be saved in the database."))) {
+
+ var params = $H({
+ message: msg,
+ xinfo: ext_info,
+ stack: e.stack,
+ browserName: navigator.appName,
+ browserVersion: navigator.appVersion,
+ browserPlatform: navigator.platform,
+ browserCookies: navigator.cookieEnabled,
+ });
+
+ var url = "http://tt-rss.org/report.php?" + params.toQueryString();
+
+ window.open(url);
+
+ }
+ },
content: content});
dialog.show();