diff --git a/frontend/app/api/redirect/[id]/route.js b/frontend/app/api/redirect/[id]/route.js index 3ea349a..c3869da 100644 --- a/frontend/app/api/redirect/[id]/route.js +++ b/frontend/app/api/redirect/[id]/route.js @@ -17,6 +17,6 @@ export async function GET(request, { params }) { return new NextResponse("URL not found", { status: 404 }); } } catch (error) { - return new NextResponse("Server error", { status: 500 }); + return NextResponse.redirect("/error"); } } diff --git a/frontend/app/api/redirect/error/page.js b/frontend/app/api/redirect/error/page.js new file mode 100644 index 0000000..af1462d --- /dev/null +++ b/frontend/app/api/redirect/error/page.js @@ -0,0 +1,25 @@ +"use client"; + +import { MdError } from "react-icons/md"; +import Link from "next/link"; + +export default function ServerErrorPage() { + return ( +
+ Oops! Something went wrong on our end. Please try again later. +
+ + + Go Back to Home + + +