mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-21 23:15:03 +00:00
Show backend error messages in downloader
This commit is contained in:
parent
631c4fef0b
commit
a86be1b702
@ -267,6 +267,15 @@
|
|||||||
console.error('Throwing error banner, response was not okay');
|
console.error('Throwing error banner, response was not okay');
|
||||||
return handleJsonResponse(response);
|
return handleJsonResponse(response);
|
||||||
}
|
}
|
||||||
|
let text = '';
|
||||||
|
try {
|
||||||
|
text = await response.text();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed reading error text', e);
|
||||||
|
}
|
||||||
|
if (text && text.trim().length > 0) {
|
||||||
|
throw new Error(text);
|
||||||
|
}
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user