fix: report all build errors to the fcc console
Previously only challenges with previews would inform the user of syntax errors. This extends that to all challenges and corrects the output format so errors are clearer.
This commit is contained in:
committed by
mrugesh
parent
890ce894cc
commit
5059d23600
@ -1,5 +1,5 @@
|
||||
.output-text {
|
||||
white-space: pre-line;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
padding-top: 0;
|
||||
height: 100%;
|
||||
|
@ -125,13 +125,15 @@ function* previewChallengeSaga() {
|
||||
return;
|
||||
}
|
||||
const challengeData = yield select(challengeDataSelector);
|
||||
if (!challengeHasPreview(challengeData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
yield put(initConsole(''));
|
||||
// try to build even if there's no preview so build errors will be reported.
|
||||
const ctx = yield buildChallengeData(challengeData);
|
||||
// then only continue if there is a preview.
|
||||
if (!challengeHasPreview(challengeData)) {
|
||||
return;
|
||||
}
|
||||
const document = yield getContext('document');
|
||||
yield call(updatePreview, ctx, document);
|
||||
} catch (err) {
|
||||
|
Reference in New Issue
Block a user