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 <ojeytonwilliams@gmail.com>
This commit is contained in:
Jacob O'Reilly
2022-01-08 07:25:38 -08:00
committed by GitHub
parent c8146f031e
commit 0009100f71

View File

@ -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)));