protected override void Execute(RequestContext requestContext) { // This is handling the case when the routing cannot match a controller, or when // the routing may identify an actual file (eg. *.cshtml). The later only seems // to end up here though if AtlasExceptionHttpModule is used. AtlasExceptionAction.ExecutePageNotFound(requestContext, null); }
public bool EndInvokeAction(IAsyncResult asyncResult) { bool result; try { result = this.actionInvoker.EndInvokeAction(asyncResult); } catch (InvalidOperationException e) { if (e.Message != "No route in the route table matches the supplied values.") { throw; } result = false; } if (!result) { // This is handling the case when the routing matches a controller, but not an action AtlasExceptionAction.ExecutePageNotFound((ControllerContext)asyncResult.AsyncState, null); } return(true); }
public bool InvokeAction(ControllerContext controllerContext, string actionName) { var result = this.actionInvoker.InvokeAction(controllerContext, actionName); if (!result) { // This is handling the case when the routing matches a controller, but not an action AtlasExceptionAction.ExecutePageNotFound(controllerContext, null); } return(true); }
private void HttpApplicationError(object sender, EventArgs e) { var httpApplication = (HttpApplication)sender; var context = httpApplication.Context; var exception = context.Server.GetLastError(); var httpException = exception as HttpException; if (httpException != null && httpException.GetHttpCode() == (int)HttpStatusCode.NotFound) { context.Server.ClearError(); AtlasExceptionAction.ExecutePageNotFound(context.Request.RequestContext, httpException); } }