Capture ice_failed errors
This commit is contained in:
parent
5c6ea69f43
commit
90f9cb9501
1 changed files with 19 additions and 0 deletions
19
src/Room.jsx
19
src/Room.jsx
|
@ -39,6 +39,7 @@ import { useMediaStream } from "matrix-react-sdk/src/hooks/useMediaStream";
|
|||
import { fetchGroupCall } from "./ConferenceCallManagerHooks";
|
||||
import { ErrorModal } from "./ErrorModal";
|
||||
import { GroupCallInspector } from "./GroupCallInspector";
|
||||
import * as Sentry from "@sentry/react";
|
||||
|
||||
const canScreenshare = "getDisplayMedia" in navigator.mediaDevices;
|
||||
// There is currently a bug in Safari our our code with cloning and sending MediaStreams
|
||||
|
@ -117,6 +118,24 @@ export function GroupCallView({ client, groupCall }) {
|
|||
hasLocalParticipant,
|
||||
} = useGroupCall(groupCall);
|
||||
|
||||
useEffect(() => {
|
||||
function onHangup(call) {
|
||||
if (call.hangupReason === "ice_failed") {
|
||||
Sentry.captureException(new Error("Call hangup due to ICE failure."));
|
||||
}
|
||||
}
|
||||
|
||||
if (groupCall) {
|
||||
groupCall.on("hangup", onHangup);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (groupCall) {
|
||||
groupCall.removeListener("hangup", onHangup);
|
||||
}
|
||||
};
|
||||
}, [groupCall]);
|
||||
|
||||
if (error) {
|
||||
return <ErrorModal error={error} />;
|
||||
} else if (state === GroupCallState.Entered) {
|
||||
|
|
Loading…
Add table
Reference in a new issue