This project is read-only.

HttpErrorHandler, proper use, registration?

Topics: Web Api
Sep 7, 2011 at 3:42 AM

Hi there,

I created:

public class BadRequestErrorHandler : HttpErrorHandler {...}

I registered it as follows:

//TODO: sb: go back to routes.MapServiceRoute when RTM is out!
// sb: this code is a workaround for an issue with wcf routes conflicting with
// mvc routes

// register route




 var config = new HttpHostConfiguration().SetErrorHandler<BadRequestErrorHandler>().AddMessageHandlers(typeof(AuthenticationMessageHandler));
var factory = new HttpConfigurableServiceHostFactory(config);
new WebApiRoute("api/test", factory, typeof(TestService)));

 From within the AuthenticationMessageHandler I throw an exception, however my HttpBadRequestErrorHandler.OnHandleError is never hit.

What am I doing wrong?



Sep 7, 2011 at 5:12 AM

It's a known issue, we are fixing it.