From 052e30aff3f902162e673e19247f9ef5a8e4e425 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 6 Aug 2019 19:58:16 +0100 Subject: [PATCH] fix: Report build errors to dev console (#36540) --- client/src/client/workers/test-evaluator.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/client/workers/test-evaluator.js b/client/src/client/workers/test-evaluator.js index 8f9d0f4e84..df0b6ea1a8 100644 --- a/client/src/client/workers/test-evaluator.js +++ b/client/src/client/workers/test-evaluator.js @@ -31,7 +31,8 @@ const __utils = (() => { } return { - postResult + postResult, + oldLog }; })(); @@ -54,7 +55,12 @@ self.onmessage = async e => { `); } catch (err) { if (__userCodeWasExecuted) { + // rethrow error, since test failed. throw err; + } else { + // report errors to dev console (not the editor console, since the test + // may still pass) + __utils.oldLog(err); } testResult = eval(e.data.testString); }