#Any good resources on Next.js error handling

17 messages · Page 1 of 1 (latest)

austere flint
#

I am trying to make same style of error handling in all my projects are there and good resources on how to do that in next.js? Like industry standard / best practices

oak elkBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

strange remnant
#

I dont know a specific good resource

#

@austere flint but

#

For one is always sending http status code and relevant error messages

#

For middlewares or api’s that use env variables

#

It good to validate env variables otherwise return 500

#

You can use chatGPT

#

And ask it for best practies or how to improve your backend code

#

And it will tell you the pattern and changes you need to make

austere flint
#

ChatGPT is really just for general stuff. It doesn't even know new syntax for "/api" is still like to learn from humans are they are somewhat better resource for niche stuff

#

Thank you! Won't mark it as a solution yet as I would really love to get specific resources.

strange remnant
#

Hmm i personally find chatgpt works well for code improvement but i guess it depends

#

I recently used it and it does a pretty good job

#

For next 14

austere flint
#

Don't get me wrong it works great but when I try to get actual best practices GPT is not my go to solution. Its good for general code tho.

strange remnant
#

I asked it to improve my api code and it can gave feedback of seperatibf logics and even showing the new proper sperated code