mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
Revert "editcheck: Remove try/catch around transaction squashing"
This reverts commitcf8a08f76c
. Reason for revert: these errors are still happening Bug: T333710 Bug: T380234 Change-Id: I4b4a061757316bf720fecc7cfd971737b68d122f (cherry picked from commit733d0a835e
)
This commit is contained in:
parent
a5200b46e5
commit
daf5d9752d
|
@ -59,7 +59,16 @@ mw.editcheck.getModifiedRanges = function ( documentModel, coveredNodesOnly ) {
|
|||
if ( !documentModel.completeHistory.getLength() ) {
|
||||
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 = [];
|
||||
let offset = 0;
|
||||
const endOffset = documentModel.getDocumentRange().end;
|
||||
|
|
Loading…
Reference in a new issue