Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch((error: Error) => {
if (process.env.NODE_ENV !== 'production') {
logger.error(`Service worker installation failed. It will ` +
`be retried automatically during the next navigation.`);
}
// Re-throw the error to ensure installation fails.
throw error;
})
);
responsePromise = responsePromise.catch((err) => {
if (process.env.NODE_ENV !== 'production') {
// Still include URL here as it will be async from the console group
// and may not make sense without the URL
logger.groupCollapsed(`Error thrown when responding to: ` +
` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);
logger.error(`Error thrown by:`, route);
logger.error(err);
logger.groupEnd();
}
return this._catchHandler!.handle({url, request, event});
});
}
responsePromise = responsePromise.catch((err) => {
if (process.env.NODE_ENV !== 'production') {
// Still include URL here as it will be async from the console group
// and may not make sense without the URL
logger.groupCollapsed(`Error thrown when responding to: ` +
` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);
logger.error(`Error thrown by:`, route);
logger.error(err);
logger.groupEnd();
}
return this._catchHandler!.handle({url, request, event});
});
}
}).catch((error) => {
if (process.env.NODE_ENV !== 'production') {
logger.error('An error occurred:', error);
}
streamDeferred.reject!(error);
throw error;
});
},