I have developed a REST application and one of my application's case is that:
User makes an operation at server side. Everything goes well server accepts data correctly however some error occurs as like communicating with database. I don't want to return it with an error code I want to send it with a success code but has a body that indicates error. I want to send error codes for 500, 404 and etc. Is my design is correct and which status code should I return for my case?