diff --git a/src/octoprint/static/js/app/dataupdater.js b/src/octoprint/static/js/app/dataupdater.js index 1dc6af37f..bd1de144d 100644 --- a/src/octoprint/static/js/app/dataupdater.js +++ b/src/octoprint/static/js/app/dataupdater.js @@ -263,7 +263,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { } self._printerErrorCancelNotification = new PNotify({ title: gettext("Error reported by printer"), - text: _.sprintf(gettext("Your printer's firmware reported an error. Due to that the ongoing print job will be cancelled. Reported error: %(firmwareError)s"), _.escape(payload)), + text: _.sprintf(gettext("Your printer's firmware reported an error. Due to that the ongoing print job will be cancelled. Reported error: %(firmwareError)s"), {firmwareError: _.escape(payload.firmwareError)}), type: "error", hide: false }); @@ -274,24 +274,24 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { switch (payload.reason) { case "firmware": { title = gettext("Error reported by printer"); - text = _.sprintf(gettext("Your printer's firmware reported an error. Due to that OctoPrint will disconnect. Reported error: %(error)s"), _.escape(payload)); + text = _.sprintf(gettext("Your printer's firmware reported an error. Due to that OctoPrint will disconnect. Reported error: %(error)s"), {error: _.escape(payload.error)}); break; } case "resend": case "resend_loop": case "timeout": { title = gettext("Communication error"); - text = _.sprintf(gettext("There was a communication error while talking to your printer. Please consult the terminal output and octoprint.log for details. Error: %(error)s"), _.escape(payload)); + text = _.sprintf(gettext("There was a communication error while talking to your printer. Please consult the terminal output and octoprint.log for details. Error: %(error)s"), {error: _.escape(payload.error)}); break; } case "connection": { title = gettext("Error connecting to printer"); - text = _.sprintf(gettext("There was an error while trying to connect to your printer. Error: %(error)s"), _.escape(payload)); + text = _.sprintf(gettext("There was an error while trying to connect to your printer. Error: %(error)s"), {error: _.escape(payload.error)}); break; } case "start_print": { title = gettext("Error starting a print"); - text = _.sprintf(gettext("There was an error while trying to start a print job. Error: %(error)s"), _.escape(payload)); + text = _.sprintf(gettext("There was an error while trying to start a print job. Error: %(error)s"), {error: _.escape(payload.error)}); break; } case "autodetect_port": @@ -301,7 +301,7 @@ function DataUpdater(allViewModels, connectCallback, disconnectCallback) { } default: { title = gettext("Unknown error"); - text = _.sprintf(gettext("There was an unknown error while talking to your printer. Please consult the terminal output and octoprint.log for details. Error: %(error)s"), _.escape(payload)); + text = _.sprintf(gettext("There was an unknown error while talking to your printer. Please consult the terminal output and octoprint.log for details. Error: %(error)s"), {error: _.escape(payload.error)}); break; } }