esoftplay 0.0.116-t → 0.0.116-u
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/modules/lib/curl.ts +8 -0
- package/package.json +1 -1
package/modules/lib/curl.ts
CHANGED
|
@@ -151,6 +151,10 @@ export default class ecurl {
|
|
|
151
151
|
fetch(this.url + this.uri + (token_uri || 'get_token'), options).then(async (res) => {
|
|
152
152
|
this.cancelTimeout()
|
|
153
153
|
let resText = await res.text()
|
|
154
|
+
if (res.status == 200 && resText == "") {
|
|
155
|
+
if (onFailed) onFailed("Koneksi internet kamu tidak stabil, silahkan coba beberapa saat lagi", false)
|
|
156
|
+
return
|
|
157
|
+
}
|
|
154
158
|
this.onFetched(resText,
|
|
155
159
|
(res, msg) => {
|
|
156
160
|
this.init(uri, { ...post, access_token: res }, onDone, onFailed, debug);
|
|
@@ -349,6 +353,10 @@ export default class ecurl {
|
|
|
349
353
|
this.cancelTimeout()
|
|
350
354
|
this.resStatus = res.status
|
|
351
355
|
let resText = await res.text()
|
|
356
|
+
if (res.status == 200 && resText == "") {
|
|
357
|
+
if (onFailed) onFailed("Koneksi internet kamu tidak stabil, silahkan coba beberapa saat lagi", false)
|
|
358
|
+
return
|
|
359
|
+
}
|
|
352
360
|
this.onFetched(resText, onDone, onFailed, debug)
|
|
353
361
|
}).catch((r) => {
|
|
354
362
|
if (this.maxRetry > 0) {
|