Changeset: Improve logged error message

I saw this on a production system today and wanted more information.
This commit is contained in:
Richard Hansen 2021-03-04 20:37:37 -05:00
parent 7fa9b07116
commit 37bb297e76

View file

@ -907,7 +907,11 @@ const textLinesMutator = (lines) => {
// there may be more chars in the line (newline is not reached)
const sline = putCurLineInSplice();
if (!curSplice[sline]) {
console.error('curSplice[sline] not populated, actual curSplice contents is ', curSplice, '. Possibly related to https://github.com/ether/etherpad-lite/issues/2802');
const err = new Error(
'curSplice[sline] not populated, actual curSplice contents is ' +
`${JSON.stringify(curSplice)}. Possibly related to ` +
'https://github.com/ether/etherpad-lite/issues/2802');
console.error(err.stack || err.toString());
}
curSplice[sline] = curSplice[sline].substring(0, curCol) + text +
curSplice[sline].substring(curCol);