Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const context = {
...additionalContext,
...getUserFlags(),
}
let options: HoneyBadgerAdditionalOptions = {}
if (additionalOptions) {
options = {...additionalOptions}
delete options.context // already included in the above context object
}
if (CLOUD) {
HoneyBadger.notify(error, {context, ...options})
let errorType = 'generic (untagged) error'
if (options.name) {
errorType = options.name
} else if (options.component) {
errorType = options.component
}
event('ui error', {error: errorType}, {errorCount: 1})
} else {
console.error(error)
}
}