public override HttpActionDescriptor SelectAction(HttpControllerContext controllerContext)
        {
            HttpActionDescriptor decriptor;

            try
            {
                decriptor = base.SelectAction(controllerContext);
            }
            catch (HttpResponseException e)
            {
                if (e.Response.StatusCode != HttpStatusCode.NotFound &&
                    e.Response.StatusCode != HttpStatusCode.MethodNotAllowed)
                {
                    throw;
                }

                controllerContext.RouteData.Values.Clear();
                IHttpController errorsController = new ErrorsController();
                controllerContext.ControllerDescriptor       = new HttpControllerDescriptor(controllerContext.Configuration, "Errors", errorsController.GetType());
                controllerContext.RouteData.Values["action"] = "Handle404";
                controllerContext.Controller = errorsController;
                decriptor = base.SelectAction(controllerContext);
            }

            return(decriptor);
        }