throw new Error(`The HTTP request failed with status code ${response.status}`);
}
return response;
} catch (err) {
const url = new URL(event.request.url);
<%# Attempt to return the index page from the cache if the user is visiting a url like devdocs.io/offline or devdocs.io/javascript/global_objects/array/find %>
<%# The index page will handle the routing %>
<%# The index page will make sure the correct documentation or a proper offline page is shown %>
if (url.origin === location.origin && !url.pathname.includes('.')) {