Skip to content

Commit 9c97b8b

Browse files
committed
error handling for literature page building
1 parent 1eacb9b commit 9c97b8b

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

ingestion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
"author": "Jimmy Paolini",
3030
"description": "lexico-ingestion",
3131
"repository": "https://github.com/JimmyPaolini/Lexico",
32-
"license": "ISC"
32+
"license": "MIT"
3333
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@
4747
"description": "lexico",
4848
"repository": "https://github.com/JimmyPaolini/Lexico",
4949
"version": "0.9.1",
50-
"license": "ISC"
50+
"license": "MIT"
5151
}

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@
4545
"author": "Jimmy Paolini",
4646
"description": "lexico-server",
4747
"repository": "https://github.com/JimmyPaolini/Lexico",
48-
"license": "ISC"
48+
"license": "MIT"
4949
}

web/src/pages/literature/[...literature].tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ export const getStaticPaths: GetStaticPaths = async () => {
6363
export const getStaticProps: GetStaticProps = async (context) => {
6464
const textId = context.params?.literature[0]!
6565
if (!textId) return { notFound: true }
66-
const initialText = await getText({ queryKey: [null, textId] })
66+
let initialText: Text
67+
try {
68+
initialText = await getText({ queryKey: [null, textId] })
69+
} catch {
70+
return { notFound: true }
71+
}
6772
if (!initialText) return { notFound: true }
6873
else return { props: { initialText } }
6974
}

0 commit comments

Comments
 (0)