protected void Application_Error(object sender, EventArgs e) { using (var customHandler = new CustomExceptionHandler(this, "~/500.cshtml")) { customHandler.HandleError(); } }