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

### Change Type
- [x] `internal` — Any other changes that don't affect the published
package
pull/2704/head
Dan Groshev 2024-02-01 11:48:07 +00:00 zatwierdzone przez GitHub
rodzic d0f6ef80fc
commit 279abff228
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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[] } }) {