Compare commits

..

No commits in common. "4dfe88a565a11067c14e573a1e49da2c28fdfbf8" and "0fd8dd0634467cd8499934f59aadb2532d6d2ffa" have entirely different histories.

3 changed files with 4 additions and 9 deletions

View File

@ -281,11 +281,11 @@ async function apiGet(url, signal) {
signal: controller.signal,
redirect: 'follow'
});
const text = await res.text();
let data;
try {
data = JSON.parse(text);
data = await res.json();
} catch {
const text = await res.text().catch(() => '');
throw new Error(`API-Antwort war kein JSON (HTTP ${res.status}): ${(text || '').slice(0, 200)}`);
}

View File

@ -65,12 +65,7 @@ async function fetchJson(url, signal) {
signal: controller.signal,
redirect: 'follow'
});
const text = await res.text();
try {
return JSON.parse(text);
} catch {
throw new Error(`Update-Server Antwort war kein JSON (HTTP ${res.status}): ${text.slice(0, 200)}`);
}
return await res.json();
} finally {
clearTimeout(timeout);
if (signal) signal.removeEventListener('abort', onAbort);

View File

@ -1,6 +1,6 @@
{
"name": "multi-hoster-uploader",
"version": "2.3.9",
"version": "2.3.8",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js",
"scripts": {