mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-02 13:48:15 +02: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');
|
||||
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}`);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user