Skip to content

Commit

Permalink
feat(data-fetching): issue a not-found if no redirect is found
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jun 25, 2024
1 parent fe647b5 commit c3cf144
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/src/rsc/data/handleFetchError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LOGTYPE, fetchRedirect, getHeadstartWPConfig, log } from '@headstartwp/core';
import { permanentRedirect, redirect } from 'next/navigation';
import { notFound, permanentRedirect, redirect } from 'next/navigation';

export async function handleFetchError(error: Error, path = '') {
const { redirectStrategy, sourceUrl, debug } = getHeadstartWPConfig();
Expand All @@ -20,5 +20,7 @@ export async function handleFetchError(error: Error, path = '') {
}
}
}

notFound();
}
}

0 comments on commit c3cf144

Please sign in to comment.