Skip to content

Commit 30eea63

Browse files
authored
Merge pull request #3337 from element-hq/robin/error-fixes
Touch up some error screens
2 parents 825b83d + a36e721 commit 30eea63

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

locales/en/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"error": {
8888
"call_is_not_supported": "Call is not supported",
8989
"call_not_found": "Call not found",
90-
"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>",
90+
"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>",
9191
"connection_lost": "Connection lost",
9292
"connection_lost_description": "You were disconnected from the call.",
9393
"e2ee_unsupported": "Incompatible browser",

src/ErrorView.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
.error > h1 {
1414
margin: 0;
15+
text-align: center;
1516
}
1617

1718
.error > p {

src/ErrorView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const ErrorView: FC<Props> = ({
9999
return (
100100
<div className={styles.error}>
101101
<BigIcon className={styles.icon}>
102-
<Icon />
102+
<Icon aria-hidden />
103103
</BigIcon>
104104
<Heading as="h1" weight="semibold" size="md">
105105
{title}

src/room/GroupCallView.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ import { callEventAudioSounds } from "./CallEventAudioRenderer";
5858
import { useLatest } from "../useLatest";
5959
import { usePageTitle } from "../usePageTitle";
6060
import {
61+
ConnectionLostError,
6162
E2EENotSupportedError,
6263
ElementCallError,
63-
ErrorCode,
64-
RTCSessionError,
6564
UnknownCallError,
6665
} from "../utils/errors.ts";
6766
import { GroupCallErrorBoundary } from "./GroupCallErrorBoundary.tsx";
@@ -153,14 +152,7 @@ export const GroupCallView: FC<Props> = ({
153152
useTypedEventEmitter(
154153
rtcSession,
155154
MatrixRTCSessionEvent.MembershipManagerError,
156-
(error) => {
157-
setExternalError(
158-
new RTCSessionError(
159-
ErrorCode.MEMBERSHIP_MANAGER_UNRECOVERABLE,
160-
error.message ?? error,
161-
),
162-
);
163-
},
155+
(error) => setExternalError(new ConnectionLostError()),
164156
);
165157
useEffect(() => {
166158
// Sanity check the room object

src/room/__snapshots__/GroupCallErrorBoundary.test.tsx.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ exports[`ConnectionLostError: Action handling should reset error state 1`] = `
112112
data-size="large"
113113
>
114114
<svg
115+
aria-hidden="true"
115116
fill="currentColor"
116117
height="1em"
117118
viewBox="0 0 24 24"
@@ -262,6 +263,7 @@ exports[`should have a close button in widget mode 1`] = `
262263
data-size="large"
263264
>
264265
<svg
266+
aria-hidden="true"
265267
fill="currentColor"
266268
height="1em"
267269
viewBox="0 0 24 24"
@@ -414,6 +416,7 @@ exports[`should render the error page with link back to home 1`] = `
414416
data-size="large"
415417
>
416418
<svg
419+
aria-hidden="true"
417420
fill="currentColor"
418421
height="1em"
419422
viewBox="0 0 24 24"
@@ -566,6 +569,7 @@ exports[`should report correct error for 'Call is not supported' 1`] = `
566569
data-size="large"
567570
>
568571
<svg
572+
aria-hidden="true"
569573
fill="currentColor"
570574
height="1em"
571575
viewBox="0 0 24 24"
@@ -718,6 +722,7 @@ exports[`should report correct error for 'Connection lost' 1`] = `
718722
data-size="large"
719723
>
720724
<svg
725+
aria-hidden="true"
721726
fill="currentColor"
722727
height="1em"
723728
viewBox="0 0 24 24"
@@ -868,6 +873,7 @@ exports[`should report correct error for 'Incompatible browser' 1`] = `
868873
data-size="large"
869874
>
870875
<svg
876+
aria-hidden="true"
871877
fill="currentColor"
872878
height="1em"
873879
viewBox="0 0 24 24"
@@ -1015,6 +1021,7 @@ exports[`should report correct error for 'Insufficient capacity' 1`] = `
10151021
data-size="large"
10161022
>
10171023
<svg
1024+
aria-hidden="true"
10181025
fill="currentColor"
10191026
height="1em"
10201027
viewBox="0 0 24 24"

src/utils/errors.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export enum ErrorCode {
1313
*/
1414
MISSING_MATRIX_RTC_FOCUS = "MISSING_MATRIX_RTC_FOCUS",
1515
CONNECTION_LOST_ERROR = "CONNECTION_LOST_ERROR",
16-
MEMBERSHIP_MANAGER_UNRECOVERABLE = "MEMBERSHIP_MANAGER_UNRECOVERABLE",
1716
/** LiveKit indicates that the server has hit its track limits */
1817
INSUFFICIENT_CAPACITY_ERROR = "INSUFFICIENT_CAPACITY_ERROR",
1918
E2EE_NOT_SUPPORTED = "E2EE_NOT_SUPPORTED",
@@ -25,7 +24,6 @@ export enum ErrorCategory {
2524
/** Calling is not supported, server misconfigured (JWT service missing, no MSC support ...)*/
2625
CONFIGURATION_ISSUE = "CONFIGURATION_ISSUE",
2726
NETWORK_CONNECTIVITY = "NETWORK_CONNECTIVITY",
28-
RTC_SESSION_FAILURE = "RTC_SESSION_FAILURE",
2927
CLIENT_CONFIGURATION = "CLIENT_CONFIGURATION",
3028
UNKNOWN = "UNKNOWN",
3129
// SYSTEM_FAILURE / FEDERATION_FAILURE ..
@@ -84,11 +82,6 @@ export class ConnectionLostError extends ElementCallError {
8482
}
8583
}
8684

87-
export class RTCSessionError extends ElementCallError {
88-
public constructor(code: ErrorCode, message: string) {
89-
super("RTCSession Error", code, ErrorCategory.RTC_SESSION_FAILURE, message);
90-
}
91-
}
9285
export class E2EENotSupportedError extends ElementCallError {
9386
public constructor() {
9487
super(
@@ -106,7 +99,7 @@ export class UnknownCallError extends ElementCallError {
10699
t("error.generic"),
107100
ErrorCode.UNKNOWN_ERROR,
108101
ErrorCategory.UNKNOWN,
109-
error.message,
102+
undefined,
110103
// Properly set it as a cause for a better reporting on sentry
111104
error,
112105
);

0 commit comments

Comments
 (0)