return 404 on missing docs content instead of 500 (#2699)

### Change Type
- [x] `internal` — Any other changes that don't affect the published
package
This commit is contained in:
Dan Groshev 2024-02-01 11:48:07 +00:00 committed by GitHub
parent d0f6ef80fc
commit 279abff228
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ async function getContentForPath(path: string) {
const article = await db.db.get(`SELECT * FROM articles WHERE articles.path = ?`, path)
if (article) return { type: 'article', article } as const
throw Error(`No content found for ${path}`)
throw notFound()
}
export async function generateMetadata({ params }: { params: { id: string | string[] } }) {