catch caches is not defined

This commit is contained in:
Gabe Yuan
2023-08-29 21:33:27 +08:00
parent 11f790ace5
commit d7cee8cca6
2 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ export const fetchData = async (
const cache = await caches.open(CACHE_NAME);
res = await cache.match(cacheReq);
} catch (err) {
console.log("[cache match]", err);
console.log("[cache match]", err.message);
}
}
@@ -151,7 +151,7 @@ export const fetchData = async (
const cache = await caches.open(CACHE_NAME);
await cache.put(cacheReq, res.clone());
} catch (err) {
console.log("[cache put]", err);
console.log("[cache put]", err.message);
}
}
}