I have created two test blog posts in our dashboard which I want to test in our SvelteKit app. Following the guide, I am able to generate the UID from the pages, but when I type in any param for a page that does not exist, it still renders instead of redirecting to a 404 with a simple try-catch. Could use some guidance on this. Code below as well as screenshot.
try....catch block works in case there are error returns from the async....await query. In Prismic, if a document is not found in the query in Client.getByUID, it returns undefined but does not throw any error.
For handling 404 here, you need to use if....else block something like this: