mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
rename to error
This commit is contained in:
@@ -139,7 +139,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
rtcSession,
|
rtcSession,
|
||||||
MatrixRTCSessionEvent.MembershipManagerError,
|
MatrixRTCSessionEvent.MembershipManagerError,
|
||||||
(error) => {
|
(error) => {
|
||||||
setUnrecoverableError(
|
setError(
|
||||||
new RTCSessionError(
|
new RTCSessionError(
|
||||||
ErrorCode.MEMBERSHIP_MANAGER_UNRECOVERABLE,
|
ErrorCode.MEMBERSHIP_MANAGER_UNRECOVERABLE,
|
||||||
error.message ?? error,
|
error.message ?? error,
|
||||||
@@ -211,7 +211,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof ElementCallError) {
|
if (e instanceof ElementCallError) {
|
||||||
// e.code === ErrorCode.MISSING_LIVE_KIT_SERVICE_URL)
|
// e.code === ErrorCode.MISSING_LIVE_KIT_SERVICE_URL)
|
||||||
setUnrecoverableError(e);
|
setError(e);
|
||||||
} else {
|
} else {
|
||||||
logger.error(`Unknown Error while entering RTC session`, e);
|
logger.error(`Unknown Error while entering RTC session`, e);
|
||||||
const error = new ElementCallError(
|
const error = new ElementCallError(
|
||||||
@@ -219,7 +219,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
ErrorCode.UNKNOWN_ERROR,
|
ErrorCode.UNKNOWN_ERROR,
|
||||||
ErrorCategory.UNKNOWN,
|
ErrorCategory.UNKNOWN,
|
||||||
);
|
);
|
||||||
setUnrecoverableError(error);
|
setError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -319,7 +319,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const [left, setLeft] = useState(false);
|
const [left, setLeft] = useState(false);
|
||||||
const [unrecoverableError, setUnrecoverableError] =
|
const [error, setError] =
|
||||||
useState<ElementCallError | null>(null);
|
useState<ElementCallError | null>(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -491,11 +491,11 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
let body: ReactNode;
|
let body: ReactNode;
|
||||||
if (unrecoverableError) {
|
if (error) {
|
||||||
// If an ElementCallError was recorded, then create a component that will fail to render and throw
|
// If an ElementCallError was recorded, then create a component that will fail to render and throw
|
||||||
// an ElementCallRichError error. This will then be handled by the ErrorBoundary component.
|
// an ElementCallRichError error. This will then be handled by the ErrorBoundary component.
|
||||||
const ErrorComponent = (): ReactNode => {
|
const ErrorComponent = (): ReactNode => {
|
||||||
throw new ElementCallRichError(unrecoverableError);
|
throw new ElementCallRichError(error);
|
||||||
};
|
};
|
||||||
body = <ErrorComponent />;
|
body = <ErrorComponent />;
|
||||||
} else if (isJoined) {
|
} else if (isJoined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user