From 85da82cd70d60bd6e00a882f1234d76f83ca62aa Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 8 May 2023 10:36:19 +0200 Subject: [PATCH] feat(cache): improve error message in console No need to try and give the data found in localStorage, just say what went wrong and move on. --- content/.vuepress/components/Cache.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/.vuepress/components/Cache.vue b/content/.vuepress/components/Cache.vue index c4073ba..f4c4a4a 100644 --- a/content/.vuepress/components/Cache.vue +++ b/content/.vuepress/components/Cache.vue @@ -48,11 +48,7 @@ if (isDataOutdated(props.name)) { try { emits('cached', of(JSON.parse(data))); } catch (err) { - console.error( - `Could not parse ${JSON.stringify( - dataFromCache - )}: ${err}. Fetching again data from API.` - ); + console.error(`Could not parse data found in cache: ${err}`); emits('cached', storeInCache(props.callback(), props.name)); } }