Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 079e5bd

Browse files
author
Manuel Proß
committed
feat(web): add error messages regarding page props and session
1 parent 65cb142 commit 079e5bd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

web/src/app/layout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,26 @@ async function getPageProps() {
3535
const data = await response.json();
3636
return data.data.attributes.items.data;
3737
} catch (error) {
38+
console.error("Error fetching page props:", error);
3839
return [];
3940
}
4041
}
4142

4243
export default async function RootLayout({ children }: { children: React.ReactNode }) {
43-
let pageProps;
44-
let session;
44+
const pageProps = [];
45+
let session = null;
4546

4647
try {
47-
pageProps = await getPageProps();
48+
const props = await getPageProps();
49+
pageProps.push(...props);
4850
} catch (error) {
49-
pageProps = [];
51+
console.error("Error fetching page properties:", error);
5052
}
5153

5254
try {
5355
session = await getServerSession();
5456
} catch (error) {
55-
session = null;
57+
console.error("Error fetching server session:", error);
5658
}
5759

5860
return (

0 commit comments

Comments
 (0)