@ipcom/asterisk-ari 0.0.35 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1933,13 +1933,18 @@ var AriClient = class {
1933
1933
  * @throws {Error} Throws an error if the WebSocket client is not connected when this method is called.
1934
1934
  * @returns {void} This function doesn't return a value.
1935
1935
  */
1936
- async onWebSocketEvent(event, callback) {
1937
- if (!this.isWebSocketConnectedFlag) {
1938
- throw new Error("WebSocket ainda n\xE3o est\xE1 conectado.");
1939
- }
1936
+ onWebSocketEvent(event, callback) {
1940
1937
  if (!this.wsClient) {
1941
- throw new Error("WebSocket n\xE3o est\xE1 configurado.");
1938
+ console.error("WebSocket n\xE3o est\xE1 configurado.");
1939
+ return;
1940
+ }
1941
+ if (!this.isWebSocketConnectedFlag) {
1942
+ console.warn(
1943
+ "WebSocket ainda n\xE3o est\xE1 conectado. Tentando reconectar..."
1944
+ );
1945
+ return;
1942
1946
  }
1947
+ console.log(`Registrando listener para evento: ${event}`);
1943
1948
  this.wsClient.on(event, callback);
1944
1949
  }
1945
1950
  /**