Body populated with error when XML/JSON serialization takes place

I had a cyclical POCO reference that was marked with XmlIgnore attributes and when a request came in and I used application/xml this returned my data however when using application/json I got a blank response.

This puts a try/catch around the call to Serialize and writes the exception message to the stream.