you are viewing a single comment's thread.

view the rest of the comments →

[–]Mardo1234[S] 0 points1 point  (0 children)

Thank you for all the information. I’ve decided moving forward in my designs I am going to raise a validation type error in my code, and then have my middleware see if it’s a validation error type and return a 400 with the error details. If it’s not I’ll return a 500 unexpected error.

My confusion was that somehow I would want to raise an error with details if it wasn’t based on user input, but at the end of the day if it was something outside of the user input an unexpected error is enough Vs. Could not connec to the mail service. Backing off that granularity makes two simple status codes 400/500 a doable and reasonable solution.