We are implementing a REST interface, and we've decided to use application/atom+xml as the output format, as it gives us a nice standard way to return a list of items together with links to the related details.
However, we are struggling to find a standard way how to return errors. I know that setting a proper HTTP error code would be required, but what about the message? Atom 1.0 RFC does not mention error handling at all, Atom Publishing Protocol RFC says the response should contain a human-readable entity with error message. However, this does not help much. What MIME type should be ideally the response? Plain text? HTML?
Is it OK that if the client sends Accept: application/atom+xml, we return Content-Type: something else? Or would you rather recommend to embed the message into an Atom Entry? I'd like to stress out that the interface is meant for machines, not human users.
Thanks a lot for your suggestions.