From f72b9db6a96e0d9530705f61e28858f25fbcdd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 2 Dec 2019 12:24:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wrong=20escape?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3362 --- src/octoprint/static/js/app/dataupdater.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; } }