async function fetchAndUpdatePosts() { let posts; try { posts = await fetchPosts(); } catch { console.log('error in fetching posts'); } if (!posts) { return; } try { await updatePosts(); } catch { console.log('error in updating posts'); } }