service2.js: Fix onFailedProofingResult not called on abort
This commit is contained in:
parent
67eee1015e
commit
49dc3385ea
@ -88,7 +88,8 @@ class BesService {
|
||||
* @param {Error} error Error
|
||||
*/
|
||||
onFailedProofingResult(error) {
|
||||
if (!this.proofingError) this.proofingError = error
|
||||
if (error !== 'AbortError' && !this.proofingError)
|
||||
this.proofingError = error
|
||||
if (--this.proofingCount <= 0) this.onEndProofing()
|
||||
}
|
||||
|
||||
@ -471,10 +472,7 @@ class BesDOMService extends BesService {
|
||||
this.markProofed(node, matches)
|
||||
this.onProofingProgress(matches.length)
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.name === 'AbortError') return
|
||||
this.onFailedProofingResult(error)
|
||||
})
|
||||
.catch(error => this.onFailedProofingResult(error))
|
||||
}
|
||||
return [{ text: `<${node.tagName}/>`, node: node, markup: true }]
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user