From 4040f78f3781b5111606b7ea85625cebba4036ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Seixas?= Date: Tue, 4 Jun 2024 09:44:26 -0300 Subject: [PATCH] remove unnecessary handle error --- src/HttpClient/middlewares/cache.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/HttpClient/middlewares/cache.ts b/src/HttpClient/middlewares/cache.ts index cbd76eed..93771649 100644 --- a/src/HttpClient/middlewares/cache.ts +++ b/src/HttpClient/middlewares/cache.ts @@ -224,8 +224,8 @@ export const cacheMiddleware = ({ type, storage, asyncSet }: CacheOptions) => { const cacheWriteSpan = createCacheSpan(cacheType, 'write', tracer, span) try { - const storageSet = async () => - await storage.set(setKey, { + const storageSet = () => + storage.set(setKey, { etag, expiration, response: {data: cacheableData, headers, status}, @@ -233,10 +233,7 @@ export const cacheMiddleware = ({ type, storage, asyncSet }: CacheOptions) => { responseType, }) if (asyncSet) { - storageSet().catch(error => { - ErrorReport.create({ originalError: error }).injectOnSpan(cacheWriteSpan) - logger?.warn({ message: 'Error writing to the HttpClient cache asynchronously', error }) - }) + storageSet() } else { await storageSet() span?.log({