logger added

This commit is contained in:
Owen Rees
2023-06-22 17:03:01 +02:00
parent 2e5d122329
commit 195a2a98fc
6 changed files with 19 additions and 6 deletions
+2
View File
@@ -3,6 +3,7 @@ import dynamic from "next/dynamic";
import Layout from "@/components/Layout";
import TournamentTable from "@/components/TournamentTable";
import { dateOrderingFrance } from "@/utils/dbDateOrdering";
import { errorLog } from "@/utils/logger";
export const revalidate = 3600; // revalidate cache every 6 hours
@@ -26,6 +27,7 @@ const getTournaments = async () => {
const data = await dateOrderingFrance(db);
return JSON.stringify(data);
} catch (error) {
errorLog(error);
throw new Error("Error fetching tournament data");
}
};