Merge pull request #3565 from LabhanshAgrawal/characterJoiner
trycatch characterJoiner handlers
This commit is contained in:
@@ -176,16 +176,25 @@ export class CharacterJoinerService implements ICharacterJoinerService {
|
|||||||
// At this point we already know that there is at least one joiner so
|
// At this point we already know that there is at least one joiner so
|
||||||
// we can just pull its value and assign it directly rather than
|
// we can just pull its value and assign it directly rather than
|
||||||
// merging it into an empty array, which incurs unnecessary writes.
|
// merging it into an empty array, which incurs unnecessary writes.
|
||||||
const joinedRanges: [number, number][] = this._characterJoiners[0].handler(text);
|
let allJoinedRanges: [number, number][] = [];
|
||||||
|
try {
|
||||||
|
allJoinedRanges = this._characterJoiners[0].handler(text);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
for (let i = 1; i < this._characterJoiners.length; i++) {
|
for (let i = 1; i < this._characterJoiners.length; i++) {
|
||||||
// We merge any overlapping ranges across the different joiners
|
// We merge any overlapping ranges across the different joiners
|
||||||
const joinerRanges = this._characterJoiners[i].handler(text);
|
try {
|
||||||
for (let j = 0; j < joinerRanges.length; j++) {
|
const joinerRanges = this._characterJoiners[i].handler(text);
|
||||||
CharacterJoinerService._mergeRanges(joinedRanges, joinerRanges[j]);
|
for (let j = 0; j < joinerRanges.length; j++) {
|
||||||
|
CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._stringRangesToCellRanges(joinedRanges, lineData, startCol);
|
this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);
|
||||||
return joinedRanges;
|
return allJoinedRanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user