Urara-Blog/node_modules/.pnpm-store/v3/files/29/58dfd375647ca1f83f3d8d542d09504d2ade9f49c7d3ce52435d7aa11ba28498fa062ecfa5e6600251131e843aa2162bdc5425d40b0def5f711e5e77f5a024
2022-08-14 01:14:53 +08:00

29 lines
816 B
Text

/*
Copyright 2019 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import {RouteHandler} from 'workbox-core/types.js';
import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
import './_version.js';
/**
* If a Route throws an error while handling a request, this `handler`
* will be called and given a chance to provide a response.
*
* @param {workbox-routing~handlerCallback} handler A callback
* function that returns a Promise resulting in a Response.
*
* @memberof workbox-routing
*/
function setCatchHandler(handler: RouteHandler): void {
const defaultRouter = getOrCreateDefaultRouter();
defaultRouter.setCatchHandler(handler);
}
export {setCatchHandler};