mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Handle errors
This commit is contained in:
@@ -2906,10 +2906,13 @@ speechSynthesis.getVoices();
|
||||
try {
|
||||
var args = await this.getFriends(params);
|
||||
friends = friends.concat(args.json);
|
||||
params.offset += 50;
|
||||
break;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
if (err?.message?.includes('Not Found')) {
|
||||
console.error('Awful workaround for awful VRC API bug');
|
||||
break;
|
||||
}
|
||||
if (j === 9) {
|
||||
throw err;
|
||||
}
|
||||
@@ -2918,6 +2921,7 @@ speechSynthesis.getVoices();
|
||||
});
|
||||
}
|
||||
}
|
||||
params.offset += 50;
|
||||
}
|
||||
return friends;
|
||||
};
|
||||
@@ -2944,10 +2948,13 @@ speechSynthesis.getVoices();
|
||||
try {
|
||||
var args = await this.getFriends(params);
|
||||
friends = friends.concat(args.json);
|
||||
params.offset += 50;
|
||||
break;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
if (err?.message?.includes('Not Found')) {
|
||||
console.error('Awful workaround for awful VRC API bug');
|
||||
break;
|
||||
}
|
||||
if (j === 9) {
|
||||
throw err;
|
||||
}
|
||||
@@ -2955,6 +2962,7 @@ speechSynthesis.getVoices();
|
||||
workerTimers.setTimeout(resolve, 5000);
|
||||
});
|
||||
}
|
||||
params.offset += 50;
|
||||
}
|
||||
}
|
||||
return friends;
|
||||
@@ -5444,9 +5452,11 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
try {
|
||||
const params = new URLSearchParams(new URL(url).search);
|
||||
let version = params.get('v');
|
||||
if (version) return version;
|
||||
return '0'
|
||||
const version = params.get('v');
|
||||
if (version) {
|
||||
return version;
|
||||
}
|
||||
return '0';
|
||||
} catch {
|
||||
return '0';
|
||||
}
|
||||
@@ -9174,7 +9184,9 @@ speechSynthesis.getVoices();
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
await API.refreshFriends();
|
||||
await API.refreshFriends().catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
API.reconnectWebSocket();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user