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

View File

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

View File

@ -3945,12 +3945,11 @@ var ZoteroPane = new function()
function reportErrors() { function reportErrors() {
var errors = Zotero.getErrors(true);
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher); .getService(Components.interfaces.nsIWindowWatcher);
var data = { var data = {
msg: Zotero.getString('errorReport.followingErrors', Zotero.appName), msg: Zotero.getString('errorReport.followingReportWillBeSubmitted'),
e: errors.join('\n\n'), errorData: Zotero.getErrors(true),
askForSteps: true askForSteps: true
}; };
var io = { wrappedJSObject: { Zotero: Zotero, data: data } }; 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()"/> <toolbarbutton id="zotero-tb-group-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newGroup;" oncommand="ZoteroPane_Local.newGroup()"/>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton id="zotero-tb-actions-menu" class="zotero-tb-button" tooltiptext="&zotero.toolbar.actions.label;" type="menu"> <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" 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-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"/> <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.general.cancel "Cancel">
<!ENTITY zotero.errorReport.title "Zotero Error Report"> <!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.submissionInProgress "Please wait while the error report is submitted.">
<!ENTITY zotero.errorReport.submitted "Your error report has been submitted."> <!ENTITY zotero.errorReport.submitted "Your error report has been submitted.">
<!ENTITY zotero.errorReport.reportID "Report ID:"> <!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.reportError = Report Error…
errorReport.reportErrors = Report Errors… errorReport.reportErrors = Report Errors…
errorReport.reportInstructions = You can report this error by selecting "%S" from the Actions (gear) menu. 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.followingReportWillBeSubmitted = The following report will be submitted:
errorReport.advanceMessage = Press %S to send an error report to the Zotero developers. 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.stepsToReproduce = Steps to Reproduce:
errorReport.expectedResult = Expected result: errorReport.expectedResult = Expected result:
errorReport.actualResult = Actual result: errorReport.actualResult = Actual result:

View File

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