瀏覽代碼

added propagation of few errors

dev1
isymchych 9 年之前
父節點
當前提交
a02143da30
共有 3 個檔案被更改,包括 41 行新增1 行删除
  1. 15
    0
      JitsiConference.js
  2. 21
    1
      JitsiConferenceErrors.js
  3. 5
    0
      doc/API.md

+ 15
- 0
JitsiConference.js 查看文件

@@ -801,6 +801,21 @@ function setupListeners(conference) {
801 801
     conference.room.addListener(XMPPEvents.BRIDGE_DOWN, function () {
802 802
         conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE);
803 803
     });
804
+    conference.room.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) {
805
+        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.RESERVATION_ERROR, code, msg);
806
+    });
807
+    conference.room.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
808
+        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.GRACEFUL_SHUTDOWN);
809
+    });
810
+    conference.room.addListener(XMPPEvents.JINGLE_FATAL_ERROR, function () {
811
+        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.JINGLE_FATAL_ERROR);
812
+    });
813
+    conference.room.addListener(XMPPEvents.MUC_DESTROYED, function (reason) {
814
+        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CONFERENCE_DESTROYED, reason);
815
+    });
816
+    conference.room.addListener(XMPPEvents.CHAT_ERROR_RECEIVED, function (err, msg) {
817
+        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CHAT_ERROR, err, msg);
818
+    });
804 819
 //    FIXME
805 820
 //    conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
806 821
 //        conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_LEFT);

+ 21
- 1
JitsiConferenceErrors.js 查看文件

@@ -27,7 +27,27 @@ var JitsiConferenceErrors = {
27 27
     /**
28 28
      * Indicates that there is no available videobridge.
29 29
      */
30
-    VIDEOBRIDGE_NOT_AVAILABLE: "conference.videobridgeNotAvailable"
30
+    VIDEOBRIDGE_NOT_AVAILABLE: "conference.videobridgeNotAvailable",
31
+    /**
32
+     * Indicates that reservation system returned error.
33
+     */
34
+    RESERVATION_ERROR: "conference.reservationError",
35
+    /**
36
+     * Indicates that graceful shutdown happened.
37
+     */
38
+    GRACEFUL_SHUTDOWN: "conference.gracefulShutdown",
39
+    /**
40
+     * Indicates that jingle fatal error happened.
41
+     */
42
+    JINGLE_FATAL_ERROR: "conference.jingleFatalError",
43
+    /**
44
+     * Indicates that conference has been destroyed.
45
+     */
46
+    CONFERENCE_DESTROYED: "conference.destroyed",
47
+    /**
48
+     * Indicates that chat error occured.
49
+     */
50
+    CHAT_ERROR: "conference.chatError"
31 51
     /**
32 52
      * Many more errors TBD here.
33 53
      */

+ 5
- 0
doc/API.md 查看文件

@@ -111,6 +111,11 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
111 111
         - PASSWORD_REQUIRED - that error can be passed when the connection to the conference failed. You should try to join the conference with password.
112 112
         - PASSWORD_NOT_SUPPORTED - indicates that conference cannot be locked
113 113
         - VIDEOBRIDGE_NOT_AVAILABLE - video bridge issues.
114
+        - RESERVATION_ERROR - error in reservation system
115
+        - GRACEFUL_SHUTDOWN - graceful shutdown
116
+        - JINGLE_FATAL_ERROR - error in jingle
117
+        - CONFERENCE_DESTROYED - conference has been destroyed
118
+        - CHAT_ERROR - chat error happened
114 119
     2. connection
115 120
         - PASSWORD_REQUIRED - passed when the connection to the server failed. You should try to authenticate with password.
116 121
         - CONNECTION_ERROR - indicates connection failures.

Loading…
取消
儲存