mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Revert "editcheck: Remove try/catch around transaction squashing"
This reverts commit cf8a08f76c
.
Reason for revert: these errors are still happening
Bug: T333710
Bug: T380234
Change-Id: I4b4a061757316bf720fecc7cfd971737b68d122f
This commit is contained in:
parent
cf8a08f76c
commit
733d0a835e
|
@ -59,7 +59,16 @@ mw.editcheck.getModifiedRanges = function ( documentModel, coveredNodesOnly ) {
|
||||||
if ( !documentModel.completeHistory.getLength() ) {
|
if ( !documentModel.completeHistory.getLength() ) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const operations = documentModel.completeHistory.squash().transactions[ 0 ].operations;
|
let operations;
|
||||||
|
try {
|
||||||
|
operations = documentModel.completeHistory.squash().transactions[ 0 ].operations;
|
||||||
|
} catch ( err ) {
|
||||||
|
// TransactionSquasher can sometimes throw errors; until T333710 is
|
||||||
|
// fixed just count this as not needing a reference.
|
||||||
|
mw.errorLogger.logError( err, 'error.visualeditor' );
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const ranges = [];
|
const ranges = [];
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
const endOffset = documentModel.getDocumentRange().end;
|
const endOffset = documentModel.getDocumentRange().end;
|
||||||
|
|
Loading…
Reference in a new issue