add code to report fatal exceptions to tt-rss.org

This commit is contained in:
Andrew Dolgov 2011-03-06 10:56:08 +03:00
parent ce68ec747a
commit ba083651fa
2 changed files with 33 additions and 1 deletions

View File

@ -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();

View File

@ -1487,6 +1487,9 @@ div.hlUpdPic img {
max-width : 16px;
}
div.fatalError {
margin-bottom : 10px;
}
div.fatalError button {
margin-top : 5px;