I think the problem is now that you have nested your queries inside Promise.all(). I might be wrong, but I suspect that if the API queries fails the error won't get caught. Try making sure that all of your queries are immediate children of your try/catch block.
I hope this message finds you well. I wanted to inform you that I have already attempted the initial solution you suggested, but unfortunately, it resulted in an internal server error. Despite this, I have gone ahead and incorporated the modifications you outlined.
When you have a moment, could you kindly review the changes? You can find the updated file at the following location: Updated File
PS: If it’s not too much trouble, could you share an example of a 404 page you’ve worked on? I believe it would be quite beneficial for me.
I thank you so much for taking the time to look into my troubles. I must admit, I feel a bit remorseful for imposing on you so frequently.
To illustrate the issue at hand, if one attempts to access a non-existent URL, such as ao.vercel.app/123 or http://localhost:5173/123, the ideal response would be a 404 error. However, it currently results in a 500 internal server error.
I would also like to mention that all valid URLs are functioning as expected without any issues.
I forgot to inform you earlier, but I’ve managed to solve the issue. I realized that I was still operating on Sveltekit’s first version, where the syntax for utilizing the error helper class has been modified. I was attempting to use it without the “throw” keyword, a beginner’s error on my part. I’m grateful for your assistance, and I’m pleased to report that everything is functioning as anticipated.