diff --git a/iframe-fetch-client/_iframe-client/main.js b/iframe-fetch-client/_iframe-client/main.js index c542df60..151c70d0 100644 --- a/iframe-fetch-client/_iframe-client/main.js +++ b/iframe-fetch-client/_iframe-client/main.js @@ -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") {