|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
816 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | Copyright 2019 Google LLC
|
|---|
| 3 |
|
|---|
| 4 | Use of this source code is governed by an MIT-style
|
|---|
| 5 | license that can be found in the LICENSE file or at
|
|---|
| 6 | https://opensource.org/licenses/MIT.
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | import {RouteHandler} from 'workbox-core/types.js';
|
|---|
| 10 |
|
|---|
| 11 | import {getOrCreateDefaultRouter} from './utils/getOrCreateDefaultRouter.js';
|
|---|
| 12 |
|
|---|
| 13 | import './_version.js';
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * If a Route throws an error while handling a request, this `handler`
|
|---|
| 17 | * will be called and given a chance to provide a response.
|
|---|
| 18 | *
|
|---|
| 19 | * @param {workbox-routing~handlerCallback} handler A callback
|
|---|
| 20 | * function that returns a Promise resulting in a Response.
|
|---|
| 21 | *
|
|---|
| 22 | * @memberof workbox-routing
|
|---|
| 23 | */
|
|---|
| 24 | function setCatchHandler(handler: RouteHandler): void {
|
|---|
| 25 | const defaultRouter = getOrCreateDefaultRouter();
|
|---|
| 26 | defaultRouter.setCatchHandler(handler);
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | export {setCatchHandler};
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.