Where can I hook the onerror event of the processors

Topics: Web Api
Mar 27, 2011 at 5:33 AM
The Microsoft.SericeModel.Http.XmlProcessor is throwing an exception when trying to serialize one of my objects. I am using the builtin HttpHostConfiguration.
        protected void Application_Start(object sender, EventArgs e)
            var config = new HttpHostConfiguration();
            RouteTable.Routes.AddServiceRoute<QueueResource>("Queue", config);
When the error occurs, the system quietly eats the error and retuns 200/blank to the browser.
I see that the processor is setting the result.Error and result.Status correctly, so clearly if I can attach to the OnError event I could get a record of the error in the processor pipeline.  
if (result.Status == ProcessorStatus.Error) { this.OnError(result); }
This prompts two questions:
  • Is this behavior by design or should an error in the processor pipeline cause a 500 error code to return?
  • Is it possible to register a listener for the OnError events, and if so when? I don't see an obvious hook around the HttpHostConfiguration class.
Thanks for all the work, I'm having fun pulling it all apart!