review: Report unknown exceptions when entering RTC session
This commit is contained in:
@@ -61,7 +61,12 @@ import { callEventAudioSounds } from "./CallEventAudioRenderer";
|
|||||||
import { useLatest } from "../useLatest";
|
import { useLatest } from "../useLatest";
|
||||||
import { usePageTitle } from "../usePageTitle";
|
import { usePageTitle } from "../usePageTitle";
|
||||||
import { ErrorView } from "../ErrorView";
|
import { ErrorView } from "../ErrorView";
|
||||||
import { ConnectionLostError, ElementCallError } from "../utils/errors.ts";
|
import {
|
||||||
|
ConnectionLostError,
|
||||||
|
ElementCallError,
|
||||||
|
ErrorCategory,
|
||||||
|
ErrorCode,
|
||||||
|
} from "../utils/errors.ts";
|
||||||
import { ElementCallRichError } from "../RichError.tsx";
|
import { ElementCallRichError } from "../RichError.tsx";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
@@ -179,6 +184,12 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
setEnterRTCError(e);
|
setEnterRTCError(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(
|
||||||
|
e.message,
|
||||||
|
ErrorCode.UNKNOWN_ERROR,
|
||||||
|
ErrorCategory.UNKNOWN,
|
||||||
|
);
|
||||||
|
setEnterRTCError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,13 +13,14 @@ 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",
|
||||||
// UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ErrorCategory {
|
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",
|
||||||
|
UNKNOWN = "UNKNOWN",
|
||||||
// SYSTEM_FAILURE / FEDERATION_FAILURE ..
|
// SYSTEM_FAILURE / FEDERATION_FAILURE ..
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ export class ElementCallError extends Error {
|
|||||||
category: ErrorCategory,
|
category: ErrorCategory,
|
||||||
localisedMessage?: string,
|
localisedMessage?: string,
|
||||||
) {
|
) {
|
||||||
super();
|
super(name);
|
||||||
this.localisedMessage = localisedMessage;
|
this.localisedMessage = localisedMessage;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
|||||||
Reference in New Issue
Block a user