mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-01-11 20:10:20 +00:00
[HD] Fix crashing issue in certain circumstances
Fixes a crashing issue when an API request fails with specific types of errors (such as ECONNRESET)
This commit is contained in:
parent
6275d5abe3
commit
be95c1f3bc
1 changed files with 1 additions and 1 deletions
|
|
@ -152,7 +152,7 @@ export default class Hidive implements ServiceClass {
|
|||
};
|
||||
let apiReq = await this.req.getData(options.url, apiReqOpts);
|
||||
if(!apiReq.ok || !apiReq.res){
|
||||
if (apiReq.error && apiReq.error.res.statusCode == 401) {
|
||||
if (apiReq.error && apiReq.error.res?.statusCode == 401) {
|
||||
console.warn('Token expired, refreshing token and retrying.');
|
||||
if (await this.refreshToken()) {
|
||||
if (authType == 'other') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue