Next.js Discord

Discord Forum

Any good resources on Next.js error handling

Unanswered
Rhinelander posted this in #help-forum
Open in Discord
RhinelanderOP
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

16 Replies

Netherland Dwarf
I dont know a specific good resource
@Rhinelander 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
RhinelanderOP
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.
Netherland Dwarf
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
RhinelanderOP
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.
Netherland Dwarf
I asked it to improve my api code and it can gave feedback of seperatibf logics and even showing the new proper sperated code
Oh okay.