handle few conference errors

This commit is contained in:
isymchych 2016-01-12 16:10:07 +02:00
parent a0355ea080
commit b3f8d8fcd3
2 changed files with 62 additions and 7 deletions

View File

@ -93,8 +93,8 @@ class ConferenceConnector {
this._unsubscribe();
this._reject(err);
}
_onConferenceFailed(err, msg = '') {
console.error('CONFERENCE FAILED:', err, msg);
_onConferenceFailed(err, ...params) {
console.error('CONFERENCE FAILED:', err, params);
switch (err) {
// room is locked by the password
case ConferenceErrors.PASSWORD_REQUIRED:
@ -105,7 +105,10 @@ class ConferenceConnector {
break;
case ConferenceErrors.CONNECTION_ERROR:
APP.UI.notifyConnectionFailed(msg);
{
let [msg] = params;
APP.UI.notifyConnectionFailed(msg);
}
break;
case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
@ -123,6 +126,39 @@ class ConferenceConnector {
AuthHandler.requireAuth(APP.conference.roomName);
break;
case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
APP.UI.notifyBridgeDown();
break;
case ConferenceErrors.RESERVATION_ERROR:
{
let [code, msg] = params;
APP.UI.notifyReservationError(code, msg);
}
break;
case ConferenceErrors.GRACEFUL_SHUTDOWN:
APP.UI.notifyGracefulShudown();
break;
case ConferenceErrors.JINGLE_FATAL_ERROR:
APP.UI.notifyInternalError();
break;
case ConferenceErrors.CONFERENCE_DESTROYED:
{
let [reason] = params;
APP.UI.notifyConferenceDestroyed(reason);
}
break;
case ConferenceErrors.CHAT_ERROR:
{
let [code, msg] = params;
APP.UI.showChatError(code, msg);
}
break;
default:
this._handleConferenceFailed(err, msg);
}

View File

@ -139,10 +139,29 @@ UI.notifyKicked = function () {
messageHandler.openMessageDialog("dialog.sessTerminated", "dialog.kickMessage");
};
UI.notifyConferenceDestroyed = function (reason) {
//FIXME: use Session Terminated from translation, but
// 'reason' text comes from XMPP packet and is not translated
var title = APP.translation.generateTranslationHTML("dialog.sessTerminated");
messageHandler.openDialog(
title, reason, true, {},
function (event, value, message, formVals) {
return false;
}
);
};
UI.notifyBridgeDown = function () {
messageHandler.showError("dialog.error", "dialog.bridgeUnavailable");
};
UI.showChatError = function (err, msg) {
if (interfaceConfig.filmStripOnly) {
return;
}
Chat.chatAddError(err, msg);
};
UI.changeDisplayName = function (id, displayName) {
ContactList.onDisplayNameChange(id, displayName);
SettingsMenu.onDisplayNameChange(id, displayName);
@ -360,10 +379,6 @@ UI.addRemoteStream = function (stream) {
VideoLayout.onRemoteStreamAdded(stream);
};
function chatAddError(errorMessage, originalText) {
return Chat.chatAddError(errorMessage, originalText);
}
UI.setSubject = function (subject) {
Chat.setSubject(subject);
};
@ -769,6 +784,10 @@ UI.notifyTokenAuthFailed = function () {
messageHandler.showError("dialog.error", "dialog.tokenAuthFailed");
};
UI.notifyInternalError = function () {
UI.messageHandler.showError("dialog.sorry", "dialog.internalError");
};
UI.updateAuthInfo = function (isAuthEnabled, login) {
let loggedIn = !!login;