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