Compare commits
2 Commits
0fd8dd0634
...
4dfe88a565
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dfe88a565 | ||
|
|
9c04426950 |
@ -281,11 +281,11 @@ async function apiGet(url, signal) {
|
||||
signal: controller.signal,
|
||||
redirect: 'follow'
|
||||
});
|
||||
const text = await res.text();
|
||||
let data;
|
||||
try {
|
||||
data = await res.json();
|
||||
data = JSON.parse(text);
|
||||
} catch {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(`API-Antwort war kein JSON (HTTP ${res.status}): ${(text || '').slice(0, 200)}`);
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,12 @@ async function fetchJson(url, signal) {
|
||||
signal: controller.signal,
|
||||
redirect: 'follow'
|
||||
});
|
||||
return await res.json();
|
||||
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)}`);
|
||||
}
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
if (signal) signal.removeEventListener('abort', onAbort);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "2.3.8",
|
||||
"version": "2.3.9",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user