Explorar el Código

优化websock.onmessage错误处理

Michael Wang hace 3 años
padre
commit
ec25b9a850
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/features/OnlineExam/Examing/setups/useWXSocket.ts

+ 3 - 2
src/features/OnlineExam/Examing/setups/useWXSocket.ts

@@ -15,7 +15,8 @@ function onAudioAnswer(event: MessageEvent<string>) {
   } catch (error) {
     logger({
       cnl: ["server"],
-      act: "JSON.parse出错",
+      act: "websocket.onmessage",
+      dtl: "JSON.parse出错",
       possibleError: error,
     });
     return;
@@ -24,7 +25,7 @@ function onAudioAnswer(event: MessageEvent<string>) {
     logger({
       cnl: ["server"],
       act: "onAudioAnswer",
-      dtl: "ws message format error",
+      dtl: "event.data.content is null, probably a connected reckon from server",
       ext: { event: JSON.stringify(event) },
     });
     return;