Error report improvements

- Always allow "Report Errors...", even when no errors

- Show submitted diagnostic info in report

- Use white background and unitalicized text for report

- Make window larger by default
This commit is contained in:
Dan Stillman 2014-05-26 20:07:41 -04:00
parent 072ae245d9
commit 59f534d56f
7 changed files with 69 additions and 45 deletions

View file

@ -6,7 +6,8 @@
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
<wizard xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="zotero-error-report" title="&zotero.errorReport.title;">
id="zotero-error-report" title="&zotero.errorReport.title;"
width="550" height="450">
<script>
<![CDATA[
@ -18,47 +19,66 @@
var Zotero = obj.Zotero;
var data = obj.data;
var msg = data.msg;
var e = data.e;
var errorData = data.errorData;
var extraData = data.extraData ? data.extraData : '';
var diagnosticInfo = false;
function init() {
var wizard = document.getElementById('zotero-error-report');
var continueButton = wizard.getButton('next');
continueButton.disabled = true;
if (document.getElementById('zotero-failure-message').hasChildNodes()) {
var textNode = document.getElementById('zotero-failure-message').firstChild;
document.getElementById('zotero-failure-message').removeChild(textNode);
}
document.getElementById('zotero-failure-message').appendChild(document.createTextNode(msg));
document.getElementById('zotero-error-message').value = e;
var continueButtonName = wizard.getButton('next').getAttribute('label');
var str = Zotero.getString('errorReport.advanceMessage', continueButtonName);
document.getElementById('zotero-advance-message').setAttribute('value', str);
Zotero.getSystemInfo(function(info) {
var errorDataText = errorData.length
? data.errorData.join('\n')
: Zotero.getString('errorReport.noErrorsLogged', Zotero.appName);
diagnosticInfo = info;
var logText = errorDataText + '\n\n'
+ (extraData !== '' ? extraData + '\n\n' : '')
+ diagnosticInfo;
if (document.getElementById('zotero-failure-message').hasChildNodes()) {
var textNode = document.getElementById('zotero-failure-message').firstChild;
document.getElementById('zotero-failure-message').removeChild(textNode);
}
document.getElementById('zotero-failure-message').appendChild(document.createTextNode(msg));
document.getElementById('zotero-error-message').value = logText;
continueButton.disabled = false;
continueButton.focus();
var str = Zotero.getString(
'errorReport.advanceMessage', continueButton.getAttribute('label')
);
document.getElementById('zotero-advance-message').setAttribute('value', str);
});
}
function sendErrorReport() {
var wizard = document.getElementById('zotero-error-report');
var continueButtonName = wizard.getButton('next').disabled = true;
var continueButton = wizard.getButton('next');
continueButton.disabled = true;
Zotero.getSystemInfo(function(info) {
var parts = {
error: "true",
errorData: Zotero.getErrors(true).join('\n'),
extraData: extraData,
diagnostic: info
};
var body = '';
for (var key in parts) {
body += key + '=' + encodeURIComponent(parts[key]) + '&';
}
body = body.substr(0, body.length - 1);
var url = 'https://repo.zotero.org/repo/report';
Zotero.HTTP.promise('POST', url,
{ body: body, successCodes: false, foreground: true })
.then(_sendErrorReportCallback)
.done();
});
var parts = {
error: "true",
errorData: errorData.join('\n'),
extraData: extraData,
diagnostic: diagnosticInfo
};
var body = '';
for (var key in parts) {
body += key + '=' + encodeURIComponent(parts[key]) + '&';
}
body = body.substr(0, body.length - 1);
var url = 'https://repo.zotero.org/repo/report';
Zotero.HTTP.promise('POST', url,
{ body: body, successCodes: false, foreground: true })
.then(_sendErrorReportCallback)
.done();
}
@ -113,11 +133,11 @@
}
wizard.advance();
wizard.getButton('cancel').setAttribute('disabled', true);
wizard.getButton('cancel').disabled = true;;
wizard.canRewind = false;
var reportID = reported[0].getAttribute('reportID');
document.getElementById('zotero-report-id').setAttribute('value', reportID);
document.getElementById('zotero-report-result').setAttribute('hidden', false);
document.getElementById('zotero-report-result').hidden = false;
}
}
]]>
@ -125,7 +145,7 @@
<wizardpage onpageshow="Zotero_Error_Report.init()" label=" ">
<description id="zotero-failure-message"/>
<textbox id="zotero-error-message" class="plain" readonly="true" multiline="true" rows="6"/>
<textbox id="zotero-error-message" class="plain" readonly="true" multiline="true" flex="1"/>
<description id="zotero-unrelated-message">&zotero.general.note; &zotero.errorReport.unrelatedMessages;</description>
<description id="zotero-advance-message"/>
</wizardpage>

View file

@ -98,7 +98,7 @@ Zotero.Schema = new function(){
.getService(Components.interfaces.nsIWindowWatcher);
var data = {
msg: obj.data.msg,
e: obj.data.e,
errorData: obj.data.e,
extraData: "Schema upgrade from " + dbVersion + " to " + schemaVersion
};
var io = { wrappedJSObject: { Zotero: Zotero, data: data } };

View file

@ -3945,12 +3945,11 @@ var ZoteroPane = new function()
function reportErrors() {
var errors = Zotero.getErrors(true);
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
var data = {
msg: Zotero.getString('errorReport.followingErrors', Zotero.appName),
e: errors.join('\n\n'),
msg: Zotero.getString('errorReport.followingReportWillBeSubmitted'),
errorData: Zotero.getErrors(true),
askForSteps: true
};
var io = { wrappedJSObject: { Zotero: Zotero, data: data } };

View file

@ -103,7 +103,7 @@
<toolbarbutton id="zotero-tb-group-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newGroup;" oncommand="ZoteroPane_Local.newGroup()"/>
<spacer flex="1"/>
<toolbarbutton id="zotero-tb-actions-menu" class="zotero-tb-button" tooltiptext="&zotero.toolbar.actions.label;" type="menu">
<menupopup id="zotero-tb-actions-popup" onpopupshowing="document.getElementById('cmd_zotero_reportErrors').setAttribute('disabled', Zotero.getErrors().length == 0)">
<menupopup id="zotero-tb-actions-popup">
<menuitem id="zotero-tb-actions-import" label="&zotero.toolbar.import.label;" command="cmd_zotero_import"/>
<menuitem id="zotero-tb-actions-import-clipboard" label="&zotero.toolbar.importFromClipboard;" command="cmd_zotero_importFromClipboard"/>
<menuitem id="zotero-tb-actions-export" label="&zotero.toolbar.export.label;" command="cmd_zotero_exportLibrary"/>

View file

@ -8,7 +8,7 @@
<!ENTITY zotero.general.cancel "Cancel">
<!ENTITY zotero.errorReport.title "Zotero Error Report">
<!ENTITY zotero.errorReport.unrelatedMessages "The error log may include messages unrelated to Zotero.">
<!ENTITY zotero.errorReport.unrelatedMessages "This may include messages unrelated to Zotero.">
<!ENTITY zotero.errorReport.submissionInProgress "Please wait while the error report is submitted.">
<!ENTITY zotero.errorReport.submitted "Your error report has been submitted.">
<!ENTITY zotero.errorReport.reportID "Report ID:">

View file

@ -81,8 +81,9 @@ upgrade.couldNotMigrate.restart = If you continue to receive this message, rest
errorReport.reportError = Report Error…
errorReport.reportErrors = Report Errors…
errorReport.reportInstructions = You can report this error by selecting "%S" from the Actions (gear) menu.
errorReport.followingErrors = The following errors have occurred since starting %S:
errorReport.advanceMessage = Press %S to send an error report to the Zotero developers.
errorReport.followingReportWillBeSubmitted = The following report will be submitted:
errorReport.noErrorsLogged = No errors have been logged since %S started.
errorReport.advanceMessage = Press %S to send the report to the Zotero developers.
errorReport.stepsToReproduce = Steps to Reproduce:
errorReport.expectedResult = Expected result:
errorReport.actualResult = Actual result:

View file

@ -4,11 +4,15 @@ description {
/* Intro pane */
#zotero-error-message {
font-style: italic;
background: #FFF;
}
#zotero-error-message .textbox-textarea {
padding: 5px !important
}
#zotero-unrelated-message {
margin: 1em 0 .5em;
margin: 1.5em 0 .5em;
}
#zotero-advance-message {