mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Properly handle server error
This commit is contained in:
parent
ae690f0c65
commit
a50f030a3b
1 changed files with 3 additions and 2 deletions
|
@ -605,12 +605,13 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||
categories
|
||||
}).then(async (response: Response) => {
|
||||
if (response.status === 200) {
|
||||
sponsorDataFound = true;
|
||||
|
||||
let recievedSegments: SponsorTime[] = await response.json();
|
||||
if (!recievedSegments.length) {
|
||||
console.error("[SponsorBlock] Server returned malformed response: " + JSON.stringify(recievedSegments));
|
||||
return;
|
||||
}
|
||||
|
||||
sponsorDataFound = true;
|
||||
|
||||
// Check if any old submissions should be kept
|
||||
if (sponsorTimes !== null) {
|
||||
|
|
Loading…
Reference in a new issue