mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 08:23:34 +00:00
Gracefully handle total response failure from site - no response at all.
This commit is contained in:
1 parent
718b2f369b
commit
c6617beb6d
1 file changed
+2
-2
@@ -221,8 +221,8 @@ class FetchClient {
|
||||
|
||||
const response = await this.rpcClient.fetch(serializedRequest);
|
||||
|
||||
if (response.status !== 200) {
|
||||
throw new Error(`Failed to fetch site index: ${response.status} ${response.statusText}`);
|
||||
if (response?.status !== 200) {
|
||||
throw new Error(`Failed to fetch site index: ${response?.status || 'Invalid response from site: ' + response} ${response?.statusText || ''}`);
|
||||
}
|
||||
|
||||
if (response.headers["Content-Type"] !== "text/html") {
|
||||
|
||||
Reference in new issue
Block a user