forked from Mirrors/elk
chore: add custom plugin to log errors
This commit is contained in:
parent
44d0e9c300
commit
40b472ce9d
1 changed files with 13 additions and 0 deletions
|
@ -63,6 +63,19 @@ if (import.meta.env.PROD) {
|
|||
ignoreVary: true,
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
fetchDidFail: async ({ error, request }) => {
|
||||
console.error('webmanifest fetchDidFail', error, request.url)
|
||||
},
|
||||
handlerDidError: async ({ error, request }) => {
|
||||
console.error('webmanifest handlerDidError', error, request.url)
|
||||
return undefined
|
||||
},
|
||||
cacheWillUpdate: async ({ request, response }) => {
|
||||
console.error('webmanifest cacheWillUpdate', request.url)
|
||||
return response?.status === 200 ? response : null
|
||||
},
|
||||
},
|
||||
new CacheableResponsePlugin({ statuses: [200] }),
|
||||
// we only need a few entries
|
||||
new ExpirationPlugin({ maxEntries: 100 }),
|
||||
|
|
Loading…
Reference in a new issue