Merge pull request #3337 from element-hq/robin/error-fixes

Touch up some error screens
This commit is contained in:
Robin
2025-06-26 09:52:35 -04:00
committed by GitHub
6 changed files with 13 additions and 20 deletions

View File

@@ -87,7 +87,7 @@
"error": { "error": {
"call_is_not_supported": "Call is not supported", "call_is_not_supported": "Call is not supported",
"call_not_found": "Call not found", "call_not_found": "Call not found",
"call_not_found_description": "<0>That link doesn't appear to belong to any existing call. Check that you have the right link, or <1>create a new one</1>.</0>", "call_not_found_description": "<0>That link doesn't appear to belong to any existing call. Check that you have the right link, or <2>create a new one</2>.</0>",
"connection_lost": "Connection lost", "connection_lost": "Connection lost",
"connection_lost_description": "You were disconnected from the call.", "connection_lost_description": "You were disconnected from the call.",
"e2ee_unsupported": "Incompatible browser", "e2ee_unsupported": "Incompatible browser",

View File

@@ -12,6 +12,7 @@
.error > h1 { .error > h1 {
margin: 0; margin: 0;
text-align: center;
} }
.error > p { .error > p {

View File

@@ -99,7 +99,7 @@ export const ErrorView: FC<Props> = ({
return ( return (
<div className={styles.error}> <div className={styles.error}>
<BigIcon className={styles.icon}> <BigIcon className={styles.icon}>
<Icon /> <Icon aria-hidden />
</BigIcon> </BigIcon>
<Heading as="h1" weight="semibold" size="md"> <Heading as="h1" weight="semibold" size="md">
{title} {title}

View File

@@ -58,10 +58,9 @@ import { callEventAudioSounds } from "./CallEventAudioRenderer";
import { useLatest } from "../useLatest"; import { useLatest } from "../useLatest";
import { usePageTitle } from "../usePageTitle"; import { usePageTitle } from "../usePageTitle";
import { import {
ConnectionLostError,
E2EENotSupportedError, E2EENotSupportedError,
ElementCallError, ElementCallError,
ErrorCode,
RTCSessionError,
UnknownCallError, UnknownCallError,
} from "../utils/errors.ts"; } from "../utils/errors.ts";
import { GroupCallErrorBoundary } from "./GroupCallErrorBoundary.tsx"; import { GroupCallErrorBoundary } from "./GroupCallErrorBoundary.tsx";
@@ -153,14 +152,7 @@ export const GroupCallView: FC<Props> = ({
useTypedEventEmitter( useTypedEventEmitter(
rtcSession, rtcSession,
MatrixRTCSessionEvent.MembershipManagerError, MatrixRTCSessionEvent.MembershipManagerError,
(error) => { (error) => setExternalError(new ConnectionLostError()),
setExternalError(
new RTCSessionError(
ErrorCode.MEMBERSHIP_MANAGER_UNRECOVERABLE,
error.message ?? error,
),
);
},
); );
useEffect(() => { useEffect(() => {
// Sanity check the room object // Sanity check the room object

View File

@@ -112,6 +112,7 @@ exports[`ConnectionLostError: Action handling should reset error state 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -262,6 +263,7 @@ exports[`should have a close button in widget mode 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -414,6 +416,7 @@ exports[`should render the error page with link back to home 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -566,6 +569,7 @@ exports[`should report correct error for 'Call is not supported' 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -718,6 +722,7 @@ exports[`should report correct error for 'Connection lost' 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -868,6 +873,7 @@ exports[`should report correct error for 'Incompatible browser' 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -1015,6 +1021,7 @@ exports[`should report correct error for 'Insufficient capacity' 1`] = `
data-size="large" data-size="large"
> >
<svg <svg
aria-hidden="true"
fill="currentColor" fill="currentColor"
height="1em" height="1em"
viewBox="0 0 24 24" viewBox="0 0 24 24"

View File

@@ -13,7 +13,6 @@ export enum ErrorCode {
*/ */
MISSING_MATRIX_RTC_FOCUS = "MISSING_MATRIX_RTC_FOCUS", MISSING_MATRIX_RTC_FOCUS = "MISSING_MATRIX_RTC_FOCUS",
CONNECTION_LOST_ERROR = "CONNECTION_LOST_ERROR", CONNECTION_LOST_ERROR = "CONNECTION_LOST_ERROR",
MEMBERSHIP_MANAGER_UNRECOVERABLE = "MEMBERSHIP_MANAGER_UNRECOVERABLE",
/** LiveKit indicates that the server has hit its track limits */ /** LiveKit indicates that the server has hit its track limits */
INSUFFICIENT_CAPACITY_ERROR = "INSUFFICIENT_CAPACITY_ERROR", INSUFFICIENT_CAPACITY_ERROR = "INSUFFICIENT_CAPACITY_ERROR",
E2EE_NOT_SUPPORTED = "E2EE_NOT_SUPPORTED", E2EE_NOT_SUPPORTED = "E2EE_NOT_SUPPORTED",
@@ -25,7 +24,6 @@ export enum ErrorCategory {
/** Calling is not supported, server misconfigured (JWT service missing, no MSC support ...)*/ /** Calling is not supported, server misconfigured (JWT service missing, no MSC support ...)*/
CONFIGURATION_ISSUE = "CONFIGURATION_ISSUE", CONFIGURATION_ISSUE = "CONFIGURATION_ISSUE",
NETWORK_CONNECTIVITY = "NETWORK_CONNECTIVITY", NETWORK_CONNECTIVITY = "NETWORK_CONNECTIVITY",
RTC_SESSION_FAILURE = "RTC_SESSION_FAILURE",
CLIENT_CONFIGURATION = "CLIENT_CONFIGURATION", CLIENT_CONFIGURATION = "CLIENT_CONFIGURATION",
UNKNOWN = "UNKNOWN", UNKNOWN = "UNKNOWN",
// SYSTEM_FAILURE / FEDERATION_FAILURE .. // SYSTEM_FAILURE / FEDERATION_FAILURE ..
@@ -84,11 +82,6 @@ export class ConnectionLostError extends ElementCallError {
} }
} }
export class RTCSessionError extends ElementCallError {
public constructor(code: ErrorCode, message: string) {
super("RTCSession Error", code, ErrorCategory.RTC_SESSION_FAILURE, message);
}
}
export class E2EENotSupportedError extends ElementCallError { export class E2EENotSupportedError extends ElementCallError {
public constructor() { public constructor() {
super( super(
@@ -106,7 +99,7 @@ export class UnknownCallError extends ElementCallError {
t("error.generic"), t("error.generic"),
ErrorCode.UNKNOWN_ERROR, ErrorCode.UNKNOWN_ERROR,
ErrorCategory.UNKNOWN, ErrorCategory.UNKNOWN,
error.message, undefined,
// Properly set it as a cause for a better reporting on sentry // Properly set it as a cause for a better reporting on sentry
error, error,
); );