The useStatamicPageErrorHandler composable is used to handle errors for Statamic page requests.
It will automatically trigger the nuxt-statamic:error hook before throwing a fatal 404 error. It's designed to handle page-not-found scenarios in a consistent way across the application.
<script setup lang="ts">
const { data, error } = await useStatamicPage();
useStatamicPageErrorHandler(error);
</script>
function useStatamicPageErrorHandler(
requestError: MaybeRefOrGetter<NuxtError | undefined>,
): void
404 error when requestError has a value