fix: throw more errors in translate api

This commit is contained in:
Gabe
2025-10-14 10:31:49 +08:00
parent c38a3d439d
commit b63ef8c1aa
4 changed files with 84 additions and 72 deletions

View File

@@ -47,11 +47,12 @@ const newCacheReq = async (input, init) => {
*/
export const getHttpCache = async ({ input, init }) => {
try {
const req = await newCacheReq(input, init);
const request = await newCacheReq(input, init);
const cache = await caches.open(CACHE_NAME);
const res = await cache.match(req);
if (res) {
return await parseResponse(res);
const response = await cache.match(request);
if (response) {
const res = await parseResponse(response);
return res;
}
} catch (err) {
kissLog("get cache", err);