Fix: display error on install page

This commit is contained in:
eight 2018-09-25 20:45:07 +08:00
parent 64aa9fcf53
commit 42e97ef153

View File

@ -242,7 +242,7 @@
const contents = Array.isArray(err) ? const contents = Array.isArray(err) ?
[$create('pre', err.join('\n'))] : [$create('pre', err.join('\n'))] :
[err && err.message && $create('pre', err.message) || err || 'Unknown error']; [err && err.message && $create('pre', err.message) || err || 'Unknown error'];
if (Number.isInteger(err.index)) { if (Number.isInteger(err.index) && typeof contents[0] === 'string') {
const pos = cm.posFromIndex(err.index); const pos = cm.posFromIndex(err.index);
contents[0] = `${pos.line + 1}:${pos.ch + 1} ` + contents[0]; contents[0] = `${pos.line + 1}:${pos.ch + 1} ` + contents[0];
contents.push($create('pre', drawLinePointer(pos))); contents.push($create('pre', drawLinePointer(pos)));