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.
This commit is contained in:
parent
e02a336353
commit
85da82cd70
@ -48,11 +48,7 @@ if (isDataOutdated(props.name)) {
|
|||||||
try {
|
try {
|
||||||
emits('cached', of(JSON.parse(data)));
|
emits('cached', of(JSON.parse(data)));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(`Could not parse data found in cache: ${err}`);
|
||||||
`Could not parse ${JSON.stringify(
|
|
||||||
dataFromCache
|
|
||||||
)}: ${err}. Fetching again data from API.`
|
|
||||||
);
|
|
||||||
emits('cached', storeInCache(props.callback(), props.name));
|
emits('cached', storeInCache(props.callback(), props.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user