try catch
This commit is contained in:
parent
a04b54ce99
commit
a4d5e5d768
1 changed files with 8 additions and 4 deletions
|
@ -9,10 +9,14 @@
|
|||
|
||||
// Pooling interval to fetch entries every 31 seconds
|
||||
interval = setInterval(async () => {
|
||||
const promise = fetchEntries();
|
||||
// wait for the promise to resolve before assigning to prevent flash
|
||||
await promise;
|
||||
entriesPromise = promise;
|
||||
try {
|
||||
const promise = fetchEntries();
|
||||
// wait for the promise to resolve before assigning to prevent flash
|
||||
await promise;
|
||||
entriesPromise = promise;
|
||||
} catch (error) {
|
||||
console.error('Error fetching entries:', error);
|
||||
}
|
||||
}, 1000 * 31);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
|
|
Loading…
Add table
Reference in a new issue