1- import { notFound } from '@tanstack/react-router'
21import { createServerFn } from '@tanstack/react-start'
32import { setResponseHeader } from '@tanstack/react-start/server'
43import removeMarkdown from 'remove-markdown'
98 fetchRepoFile ,
109 isRecoverableGitHubContentError ,
1110} from '~/utils/documents.server'
11+ import { createDocsNotFoundError } from './docs-errors'
1212import { renderMarkdownToRsc } from './markdown'
1313import { getCachedDocsArtifact } from './github-content-cache.server'
1414import { buildRedirectManifest , type RedirectManifestEntry } from './redirects'
@@ -223,7 +223,7 @@ export const fetchDocs = createServerFn({ method: 'GET' })
223223 const file = await readRepoFileOrFallback ( repo , branch , filePath )
224224
225225 if ( ! file ) {
226- throw notFound ( )
226+ throw createDocsNotFoundError ( )
227227 }
228228
229229 const frontMatter = extractFrontMatter ( file )
@@ -267,7 +267,7 @@ export const fetchFile = createServerFn({ method: 'GET' })
267267 const file = await readRepoFileOrFallback ( repo , branch , filePath )
268268
269269 if ( ! file ) {
270- throw notFound ( )
270+ throw createDocsNotFoundError ( )
271271 }
272272
273273 setDocsCacheHeaders ( 'max-age=3600, stale-while-revalidate=3600, durable' )
@@ -284,7 +284,7 @@ export const fetchRepoDirectoryContents = createServerFn({
284284 const githubContents = await fetchApiContents ( repo , branch , startingPath )
285285
286286 if ( ! githubContents ) {
287- throw notFound ( )
287+ throw createDocsNotFoundError ( )
288288 }
289289
290290 setDocsCacheHeaders ( 'max-age=3600, stale-while-revalidate=3600, durable' )
0 commit comments