After years of (amateur, dirty) personal API development I finally decided to follow some best practices.
My problem: the API may have problems, say, retrieving some data. It will gracefully handle the problem but needs to pass that information back to the requester (a JS front of mine, if that matters).
My question: should I use some HTTP error code to inform about that problem, or send back
200 and explain in the body that there is a problem?
Another question tackled the issue for problems with the request (i.e. – the requester sent something that was not correct). My issue is likely different because the requester sent a correct request, but it was not honored by the API (it is the fault of the API). The requester does not care about the nature of the problem, they just know that they should discard that call.