Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

CONFERENCE_FAILED error as object

Lyubo Marinovc98e7a204cb9
diff --git a/react/features/authentication/middleware.js b/react/features/authentication/middleware.js
index b9305d1dee..f0012a73f6 100644
--- a/react/features/authentication/middleware.js
+++ b/react/features/authentication/middleware.js
@@ -75,7 +75,8 @@ MiddlewareRegistry.register(store => next => action => {
}
case CONFERENCE_FAILED:
- if (action.error === JitsiConferenceErrors.AUTHENTICATION_REQUIRED) {
+ if (action.error.name
+ === JitsiConferenceErrors.AUTHENTICATION_REQUIRED) {
store.dispatch(waitForOwner());
} else {
store.dispatch(stopWaitForOwner());
diff --git a/react/features/base/conference/actionTypes.js b/react/features/base/conference/actionTypes.js
index f1336be305..9688a5a71d 100644
--- a/react/features/base/conference/actionTypes.js
+++ b/react/features/base/conference/actionTypes.js
@@ -4,7 +4,7 @@
* {
* type: CONFERENCE_FAILED,
* conference: JitsiConference,
- * error: string
+ * error: Error
* }
*/
export const CONFERENCE_FAILED = Symbol('CONFERENCE_FAILED');
diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.js
index 77c7b04a00..6b64d5f6e5 100644
--- a/react/features/base/conference/actions.js
+++ b/react/features/base/conference/actions.js
@@ -159,7 +159,7 @@ function _setLocalParticipantData(conference, state) {
* @returns {{
* type: CONFERENCE_FAILED,
* conference: JitsiConference,
- * error: string
+ * error: Error
* }}
* @public
*/
@@ -167,7 +167,12 @@ export function conferenceFailed(conference: Object, error: string) {
return {
type: CONFERENCE_FAILED,
conference,
- error
+
+ // Make the error resemble an Error instance (to the extent that
+ // jitsi-meet needs it).
+ error: {
+ name: error
+ }
};
}
diff --git a/react/features/base/conference/reducer.js b/react/features/base/conference/reducer.js
index 51983411b9..1d109449f6 100644
--- a/react/features/base/conference/reducer.js
+++ b/react/features/base/conference/reducer.js
@@ -89,7 +89,7 @@ function _conferenceFailed(state, { conference, error }) {
let authRequired;
let passwordRequired;
- switch (error) {
+ switch (error.name) {
case JitsiConferenceErrors.AUTHENTICATION_REQUIRED:
authRequired = conference;
break;
diff --git a/react/features/overlay/reducer.js b/react/features/overlay/reducer.js
index 27942dcea9..d9832655c2 100644
--- a/react/features/overlay/reducer.js
+++ b/react/features/overlay/reducer.js
@@ -56,12 +56,20 @@ ReducerRegistry.register('features/overlay', (state = {}, action) => {
* @returns {Object} The new state of the feature overlay after the reduction of
* the specified action.
*/
-function _conferenceFailed(state, { error, message }) {
- if (error === JitsiConferenceErrors.FOCUS_LEFT
- || error === JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE) {
+function _conferenceFailed(state, { error: { message, name } }) {
+ if (name === JitsiConferenceErrors.FOCUS_LEFT
+ || name === JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE) {
return assign(state, {
haveToReload: true,
isNetworkFailure: false,
+
+ // FIXME There is no message associated with CONFERENCE_FAILED at
+ // the time of this writing. In jitsi-meet the action creator
+ // conferenceFailed neither accepts an argument message nor defines
+ // a property message on the error. In lib-jitsi-meet
+ // CONFERENCE_FAILED emissions mostly do not provide a message with
+ // the exception of at least one which provides an Error, not a
+ // string.
reason: message
});
}
diff --git a/react/features/room-lock/middleware.js b/react/features/room-lock/middleware.js
index 85a50ae45e..9158e2f3e5 100644
--- a/react/features/room-lock/middleware.js
+++ b/react/features/room-lock/middleware.js
@@ -27,7 +27,8 @@ MiddlewareRegistry.register(store => next => action => {
case CONFERENCE_FAILED: {
const { conference, error } = action;
- if (conference && error === JitsiConferenceErrors.PASSWORD_REQUIRED) {
+ if (conference
+ && error.name === JitsiConferenceErrors.PASSWORD_REQUIRED) {
store.dispatch(_openPasswordRequiredPrompt(conference));
}
break;