For my API, I need to respond every request's error with HTTP 200 and a JSON content. So instead of, responding with this:
Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
I'd like to do this:
res = {"code": 400, "message": "Bad Requset"}
Response(res)
Where is the best place to put such thing and how? In Serializer, Renderer, Exception? I need to catch every exception that serializer might throw as well as custom exception that I have written.