error may be an object

This commit is contained in:
tophf 2022-06-23 21:29:52 +03:00
parent 88a0a3858c
commit 3d6b55e53e

View File

@ -419,7 +419,7 @@ function LivePreview() {
el.hidden = true; el.hidden = true;
} catch (err) { } catch (err) {
if (Array.isArray(err)) { if (Array.isArray(err)) {
err = err.join('\n'); err = err.map(e => e.message || e).join('\n');
} else if (err && err.index != null) { } else if (err && err.index != null) {
// FIXME: this would fail if editors[0].getValue() !== data.sourceCode // FIXME: this would fail if editors[0].getValue() !== data.sourceCode
const pos = editor.getEditors()[0].posFromIndex(err.index); const pos = editor.getEditors()[0].posFromIndex(err.index);