@larksuiteoapi/node-sdk 1.49.0-alpha.2 → 1.49.0
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.
- package/es/index.js +10 -1
- package/lib/index.js +10 -1
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -82804,7 +82804,16 @@ class WSClient {
|
|
|
82804
82804
|
}
|
|
82805
82805
|
connect() {
|
|
82806
82806
|
const connectUrl = this.wsConfig.getWS('connectUrl');
|
|
82807
|
-
|
|
82807
|
+
let wsInstance;
|
|
82808
|
+
try {
|
|
82809
|
+
wsInstance = new WebSocket(connectUrl);
|
|
82810
|
+
}
|
|
82811
|
+
catch (e) {
|
|
82812
|
+
this.logger.error('[ws]', 'new WebSocket error');
|
|
82813
|
+
}
|
|
82814
|
+
if (!wsInstance) {
|
|
82815
|
+
return Promise.resolve(false);
|
|
82816
|
+
}
|
|
82808
82817
|
return new Promise((resolve) => {
|
|
82809
82818
|
wsInstance.on('open', () => {
|
|
82810
82819
|
this.logger.debug('[ws]', 'ws connect success');
|
package/lib/index.js
CHANGED
|
@@ -82819,7 +82819,16 @@ class WSClient {
|
|
|
82819
82819
|
}
|
|
82820
82820
|
connect() {
|
|
82821
82821
|
const connectUrl = this.wsConfig.getWS('connectUrl');
|
|
82822
|
-
|
|
82822
|
+
let wsInstance;
|
|
82823
|
+
try {
|
|
82824
|
+
wsInstance = new WebSocket__default["default"](connectUrl);
|
|
82825
|
+
}
|
|
82826
|
+
catch (e) {
|
|
82827
|
+
this.logger.error('[ws]', 'new WebSocket error');
|
|
82828
|
+
}
|
|
82829
|
+
if (!wsInstance) {
|
|
82830
|
+
return Promise.resolve(false);
|
|
82831
|
+
}
|
|
82823
82832
|
return new Promise((resolve) => {
|
|
82824
82833
|
wsInstance.on('open', () => {
|
|
82825
82834
|
this.logger.debug('[ws]', 'ws connect success');
|