I am fetching records from the database in system level API and I want to throw 404 Not Found when the records array is empty. I am using validation component to validate the size of payload and I set a message. But this ends up with the 500 status code.
5 answers