Regardless of what exceptions I throw, the calling client only receives a System.Net.WebException with no inner exception and no information beyond "The remote server returned an error: (500) Internal Server Error."
Is there a better way of returning exceptions so that I can know what actually occurred?
My current resources do something along these lines:
[WebInvoke(UriTemplate = "", Method = "POST")]
public HttpResponseMessage<Models.Payload> Post(Models.Payload newPayload)
var data = AutoMapper.Mapper.Map<Models.Payload, Data.Payload>(newPayload);
var createdPayload = _payloadService.AddPayload(data);
var retVal = AutoMapper.Mapper.Map<Data.Payload, Models.Payload>(createdPayload);
var response = new HttpResponseMessage<Models.Payload>(retVal, HttpStatusCode.OK);
catch (Exception ex)
throw new WebException(ex.Message,ex);
PS If anyone is having trouble with the Insert Code Snippet window here, the NoScript plugin for Firefox is cleansing the request back to www.codeplex.com as an XSS attack :\ Add ^http://www.codeplex.com to your XSS white list and it works ok.