From 49dc3385ea3c8c2d867a440003c46e5d3d704b3e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 21 May 2024 18:30:04 +0200 Subject: [PATCH] service2.js: Fix onFailedProofingResult not called on abort --- service2.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/service2.js b/service2.js index b51f7d1..322bf33 100644 --- a/service2.js +++ b/service2.js @@ -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 {