From 93d454a5b33e44353ddd3df69fe977d5bda16cc4 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 24 Apr 2024 16:43:33 +0200 Subject: [PATCH] fix: replace other messages with any build error (#54505) --- .../templates/Challenges/redux/execute-challenge-saga.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/templates/Challenges/redux/execute-challenge-saga.js b/client/src/templates/Challenges/redux/execute-challenge-saga.js index 053c745adc1..5d1d2fa02f8 100644 --- a/client/src/templates/Challenges/redux/execute-challenge-saga.js +++ b/client/src/templates/Challenges/redux/execute-challenge-saga.js @@ -298,14 +298,15 @@ export function* previewChallengeSaga(action) { } } } catch (err) { - console.log('previewChallengeSaga error', err); if (err[0] === 'timeout') { // TODO: translate the error // eslint-disable-next-line no-ex-assign err[0] = `The code you have written is taking longer than the ${previewTimeout}ms our challenges allow. You may have created an infinite loop or need to write a more efficient algorithm`; } - console.log(err); - yield put(updateConsole(escape(err))); + // If the preview fails, the most useful thing to do is to show the learner + // what the error is. As such, we replace whatever is in the console with + // the error message. + yield put(initConsole(escape(err))); } }