UI server: logging and code refinements
[e-mobility-charging-stations-simulator.git] / src / ui / web / src / composable / UIClient.ts
index f699a837e9524fa0d981fd4e503db568f423b83d..2095b1671775eb2f60c622e3c9b4e7fb4a50697b 100644 (file)
@@ -97,6 +97,9 @@ export default class UIClient {
       config.emobility.protocol
     );
     this._ws.onmessage = this.responseHandler.bind(this);
+    this._ws.onerror = (error) => {
+      console.error('WebSocket error: ', error);
+    };
   }
 
   private setResponseHandler(
@@ -160,7 +163,7 @@ export default class UIClient {
           this.getResponseHandler(uuid)?.reject(response);
           break;
         default:
-          throw new Error(`Response status not supported: ${response.status}`);
+          console.error(`Response status not supported: ${response.status}`);
       }
       this.deleteResponseHandler(uuid);
     } else {