Enrich fatal HLS errors in Sentry (#11359)
This commit is contained in:
@@ -4,12 +4,14 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {type Metadata} from '#/logger/types'
|
||||
import {ErrorScreen} from './error/ErrorScreen'
|
||||
import {CenteredView} from './Views'
|
||||
|
||||
interface Props {
|
||||
children?: ReactNode
|
||||
renderError?: (error: any) => ReactNode
|
||||
getErrorMetadata?: (error: Error) => Metadata
|
||||
style?: StyleProp<ViewStyle>
|
||||
}
|
||||
|
||||
@@ -29,7 +31,10 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
}
|
||||
|
||||
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
logger.error(error, {errorInfo})
|
||||
logger.error(error, {
|
||||
errorInfo,
|
||||
...this.props.getErrorMetadata?.(error),
|
||||
})
|
||||
}
|
||||
|
||||
public render() {
|
||||
|
||||
Reference in New Issue
Block a user