Add cause to "spell check loading failed" error (#22923)

GitOrigin-RevId: 37772c842bb9d92200c08fa7ce89ec0b85fe1b94
This commit is contained in:
Alf Eaton
2025-01-20 09:05:02 +00:00
committed by Copybot
parent a25a8c52ab
commit 0415ab2a60
2 changed files with 9 additions and 4 deletions
@@ -160,9 +160,14 @@ export class HunspellManager {
} else if (rest.loaded) {
this.loaded = true
} else if (rest.loadingFailed) {
captureException(new Error('Spell check loading failed'), {
tags: { ol_spell_check_language: this.language },
})
captureException(
new Error('Spell check loading failed', {
cause: rest.loadingFailed,
}),
{
tags: { ol_spell_check_language: this.language },
}
)
this.loadingFailed = true
this.pendingMessages.length = 0
}
@@ -171,7 +171,7 @@ self.addEventListener('message', async event => {
self.postMessage({ loaded: true })
} catch (error) {
console.error(error)
self.postMessage({ loadingFailed: true })
self.postMessage({ loadingFailed: error })
}
break