-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom 404 page/logic when story does not exist in Storyblok #936
Comments
Hi @thebspin , the example you are following is very simple, and doesn't manage any kind of errors (like story not found etc). Here because the Example: return storyblokApi
.get("cdn/stories/home", {
version: "draft",
resolve_relations: resolveRelations,
})
.then((dataStory) => {
return {
story: dataStory.data.story,
siteConfig: siteConfig.data.story,
error: false,
};
})
.catch((error) => {
return {
story: {},
siteConfig: siteConfig.data.story,
error: error,
};
}); |
Describe the issue you're facing
I'm using the SDK only setting the version to published.
Inside my page.ts file i'm calling the storyblokAPi.get function to get a page that does not exist.
I would like to check if this page exists or not and be able to return my own 404 (that i want to call from Storyblok aswell).
Currently in my terminal i do see this:
But my frontend itself shows:
I tried debugging and placing breakpoints after calling the storyblokApi.get function but it seems it does not even get passed that.
Reproduction
https://github.com/storyblok/storyblok-svelte/tree/main/playground-sveltekit
Steps to reproduce
Follow the tutorial that results in this: https://github.com/storyblok/storyblok-svelte/tree/main/playground-sveltekit
Call a not existing page in Storyblok
System Info
Used Package Manager
npm
Error logs (Optional)
No response
Validations
The text was updated successfully, but these errors were encountered: