mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Merge pull request #2530 from webzwo0i/exception-handling-for-mimatched-composition
do not crash when encountering mismatched compositions. log the changese...
This commit is contained in:
commit
b404af7c17
1 changed files with 9 additions and 4 deletions
|
@ -1634,11 +1634,16 @@ function composePadChangesets(padId, startNum, endNum, callback)
|
||||||
changeset = changesets[startNum];
|
changeset = changesets[startNum];
|
||||||
var pool = pad.apool();
|
var pool = pad.apool();
|
||||||
|
|
||||||
for(var r=startNum+1;r<endNum;r++)
|
try {
|
||||||
{
|
for(var r=startNum+1;r<endNum;r++) {
|
||||||
var cs = changesets[r];
|
var cs = changesets[r];
|
||||||
changeset = Changeset.compose(changeset, cs, pool);
|
changeset = Changeset.compose(changeset, cs, pool);
|
||||||
}
|
}
|
||||||
|
} catch(e){
|
||||||
|
// r-1 indicates the rev that was build starting with startNum, applying startNum+1, +2, +3
|
||||||
|
console.warn("failed to compose cs in pad:",padId," startrev:",startNum," current rev:",r);
|
||||||
|
return callback(e);
|
||||||
|
}
|
||||||
|
|
||||||
callback(null);
|
callback(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue