From 08f9f5a15d40a32f9e2d323d84a3563dbe513cdf Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Thu, 24 Oct 2024 15:26:50 +0300 Subject: [PATCH] add catch block --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 5aa142a..db55e5a 100644 --- a/server.js +++ b/server.js @@ -143,8 +143,10 @@ app.get('/calendar/:name', async (req, res) => { }); } } + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Failed to retrieve calendar data.' }); } - }); // Serve the merged calendar file