File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111} from "@chakra-ui/react" ;
1212import { useEffect , useRef , useState } from "react" ;
1313import { FullQuestion } from "../utils/types" ;
14- import { startSpan } from "@sentry/react" ;
14+ import { logger , startSpan } from "@sentry/react" ;
1515
1616interface AudioPlayerProps {
1717 fullQuestion : FullQuestion ;
@@ -98,7 +98,13 @@ export function AudioPlayer({ fullQuestion }: AudioPlayerProps) {
9898 audioRef . current ?. pause ( ) ;
9999 } else {
100100 startSpan ( { name : "AudioPlayer: play audio" } , async ( ) => {
101- await audioRef . current ?. play ( ) ;
101+ try {
102+ await audioRef . current ?. play ( ) ;
103+ } catch ( e ) {
104+ if ( e instanceof Error && e . name !== "AbortError" ) {
105+ logger . warn ( e . message ) ;
106+ }
107+ }
102108 } ) ;
103109 }
104110 } ;
You can’t perform that action at this time.
0 commit comments