mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Use ol_spell_check_language
tag for error reporting (#21126)
GitOrigin-RevId: 11580f8dca22b0d4858dc5db36827b69a3637371
This commit is contained in:
parent
17b66e495f
commit
a238b8eee4
4 changed files with 11 additions and 4 deletions
|
@ -127,7 +127,7 @@ export class SpellChecker {
|
|||
debugConsole.error(result.error)
|
||||
captureException(
|
||||
new Error('Error running spellcheck for word'),
|
||||
{ language: this.language }
|
||||
{ tags: { ol_spell_check_language: this.language } }
|
||||
)
|
||||
} else {
|
||||
processResult(result.misspellings)
|
||||
|
|
|
@ -66,7 +66,7 @@ export const SpellingSuggestions: FC<{
|
|||
})
|
||||
.catch(error => {
|
||||
captureException(error, {
|
||||
language: spellCheckLanguage,
|
||||
tags: { ol_spell_check_language: spellCheckLanguage },
|
||||
})
|
||||
debugConsole.error(error)
|
||||
})
|
||||
|
|
|
@ -161,7 +161,7 @@ export class HunspellManager {
|
|||
this.loaded = true
|
||||
} else if (rest.loadingFailed) {
|
||||
captureException(new Error('Spell check loading failed'), {
|
||||
language: this.language,
|
||||
tags: { ol_spell_check_language: this.language },
|
||||
})
|
||||
this.loadingFailed = true
|
||||
this.pendingMessages.length = 0
|
||||
|
|
|
@ -101,7 +101,14 @@ function nullReporter() {
|
|||
})
|
||||
}
|
||||
|
||||
export function captureException(err: Error, options?: Record<string, any>) {
|
||||
// https://develop.sentry.dev/sdk/data-model/event-payloads/contexts/
|
||||
// https://docs.sentry.io/platforms/javascript/enriching-events/context/#passing-context-directly
|
||||
type Options = {
|
||||
tags?: Record<string, any>
|
||||
extra?: Record<string, any>
|
||||
}
|
||||
|
||||
export function captureException(err: Error, options?: Options) {
|
||||
options = options || {}
|
||||
const extra = Object.assign(OError.getFullInfo(err), options.extra || {})
|
||||
const fullStack = OError.getFullStack(err)
|
||||
|
|
Loading…
Reference in a new issue