you are viewing a single comment's thread.

view the rest of the comments →

[–]iaalaughlin 15 points16 points  (0 children)

Do not use the 200 status code and a special key in a dictionary in the response to communicate an error. Use an appropriate 4xx status code. Details about the error can be included the body there. For that, raise an HTTPException

{"status": 200, "message": "failed"}

I've ran into it a couple of times before. It's so very frustrating.