What are the best practices for the structure of an error in a REST API? I know that I should use the codes in HTTP to describe it (REST API error return good practices), but a structure is always useful, and I found myself always using something like a type of error and a reason of the error (raise CanNotCreate('Because of this')
).
What are the best practices to define the structure of an error message? Can you give an example of any particular API with a good error handling?