diff --git a/app/_components/AlertMessage.tsx b/app/_components/AlertMessage.tsx index 3da3b9c..d78e754 100644 --- a/app/_components/AlertMessage.tsx +++ b/app/_components/AlertMessage.tsx @@ -18,24 +18,31 @@ const AlertMessage: React.FC = async () => if (!process.env.ALERT_TEXT_URL) return null; - const response: Response = await fetch(process.env.ALERT_TEXT_URL, { cache: "no-cache" }); - const alertText: string = await response.text(); + try + { + const response: Response = await fetch(process.env.ALERT_TEXT_URL, { cache: "no-cache" }); + const alertText: string = await response.text(); - if (!response.ok || !alertText) - return null; + if (!response.ok || !alertText) + return null; - const title: string = alertText.split("\n", 1)[0]; - const message: string = alertText.substring(title.length); + const title: string = alertText.split("\n", 1)[0]; + const message: string = alertText.substring(title.length); - return ( -
{ title }
- + return ( +{ title }
+ +