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 {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user