From 1770cf05879df7c0f27f15eee877ca0c201fc8a8 Mon Sep 17 00:00:00 2001 From: jarellb Date: Thu, 24 Oct 2024 09:58:36 -1000 Subject: [PATCH] Made handleFetch async to await sendStackTrace --- ui/src/app/(home)/_components/announcements.tsx | 2 +- ui/src/app/ErrorBoundary.tsx | 10 ++++++++++ ui/src/app/layout.tsx | 17 ++++++++++------- ui/src/lib/http-client.ts | 5 +++-- ui/tests/lib/fetchers.test.ts | 3 ++- 5 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 ui/src/app/ErrorBoundary.tsx diff --git a/ui/src/app/(home)/_components/announcements.tsx b/ui/src/app/(home)/_components/announcements.tsx index cb9637b9..387b8c2f 100644 --- a/ui/src/app/(home)/_components/announcements.tsx +++ b/ui/src/app/(home)/_components/announcements.tsx @@ -26,4 +26,4 @@ const Announcements = async () => { ); }; -export default Announcements; +export default Announcements; \ No newline at end of file diff --git a/ui/src/app/ErrorBoundary.tsx b/ui/src/app/ErrorBoundary.tsx new file mode 100644 index 00000000..1ef5dccf --- /dev/null +++ b/ui/src/app/ErrorBoundary.tsx @@ -0,0 +1,10 @@ +'use client'; +import ApiErrorModal from '@/components/modal/api-error-modal'; + +export default function ErrorBoundary() { + return ( + <> + + + ); +} diff --git a/ui/src/app/layout.tsx b/ui/src/app/layout.tsx index 4f99a11f..98fe2c8e 100644 --- a/ui/src/app/layout.tsx +++ b/ui/src/app/layout.tsx @@ -2,6 +2,7 @@ import './globals.css'; import { Source_Sans_3 } from 'next/font/google'; import Navbar from '@/components/layout/navbar/navbar'; import Footer from '@/components/layout/footer'; +import ErrorBoundary from '@/app/ErrorBoundary'; import type { Metadata } from 'next'; const sourceSans3 = Source_Sans_3({ @@ -20,13 +21,15 @@ const RootLayout = ({ }: Readonly<{ children?: React.ReactNode; }>) => ( - - - -
{children}
-