From 0415ab2a605e16056c05d25c722ffd79a3fc6103 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 17 Jan 2025 10:33:17 +0000 Subject: [PATCH] Add cause to "spell check loading failed" error (#22923) GitOrigin-RevId: 37772c842bb9d92200c08fa7ce89ec0b85fe1b94 --- .../source-editor/hunspell/HunspellManager.ts | 11 ++++++++--- .../source-editor/hunspell/hunspell.worker.ts | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/hunspell/HunspellManager.ts b/services/web/frontend/js/features/source-editor/hunspell/HunspellManager.ts index 690cee45b5..6513a07a49 100644 --- a/services/web/frontend/js/features/source-editor/hunspell/HunspellManager.ts +++ b/services/web/frontend/js/features/source-editor/hunspell/HunspellManager.ts @@ -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 } diff --git a/services/web/frontend/js/features/source-editor/hunspell/hunspell.worker.ts b/services/web/frontend/js/features/source-editor/hunspell/hunspell.worker.ts index a287bbdb4a..b056434b37 100644 --- a/services/web/frontend/js/features/source-editor/hunspell/hunspell.worker.ts +++ b/services/web/frontend/js/features/source-editor/hunspell/hunspell.worker.ts @@ -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