From 0009100f712d0486befc718d606260c38053120d Mon Sep 17 00:00:00 2001 From: Jacob O'Reilly Date: Sat, 8 Jan 2022 07:25:38 -0800 Subject: [PATCH] fix(client): show error messages instead of timeout (#43744) * Fixed Error message update not displaying when timeout happens when there was an error in the code. Working on fixing the timeout it self. * refactor: remove comment + log changes Co-authored-by: Oliver Eyton-Williams --- .../src/templates/Challenges/redux/execute-challenge-saga.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/templates/Challenges/redux/execute-challenge-saga.js b/client/src/templates/Challenges/redux/execute-challenge-saga.js index 028e84ea90..1b28f64752 100644 --- a/client/src/templates/Challenges/redux/execute-challenge-saga.js +++ b/client/src/templates/Challenges/redux/execute-challenge-saga.js @@ -225,10 +225,10 @@ function* previewChallengeSaga({ flushLogs = true } = {}) { } } } catch (err) { - if (err === 'timeout') { + if (err[0] === 'timeout') { // TODO: translate the error // eslint-disable-next-line no-ex-assign - err = `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`; + 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)));