diff --git a/core/includes/file.inc b/core/includes/file.inc
index f204989..6a82de0 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -2026,7 +2026,7 @@ function file_download() {
       $function = $module . '_file_download';
       $result = $function($uri);
       if ($result == -1) {
-        return drupal_access_denied();
+        throw new AccessDeniedHttpException();
       }
       if (isset($result) && is_array($result)) {
         $headers = array_merge($headers, $result);
@@ -2035,7 +2035,7 @@ function file_download() {
     if (count($headers)) {
       file_transfer($uri, $headers);
     }
-    return drupal_access_denied();
+    throw new AccessDeniedHttpException();
   }
   return drupal_not_found();
 }
diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc
index aedde16..655d85c 100644
--- a/core/modules/book/book.pages.inc
+++ b/core/modules/book/book.pages.inc
@@ -88,7 +88,7 @@ function book_export_html($nid) {
     }
   }
   else {
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
   }
 }
 
diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc
index bf096a7..ad06035 100644
--- a/core/modules/contact/contact.pages.inc
+++ b/core/modules/contact/contact.pages.inc
@@ -21,7 +21,7 @@ function contact_site_form($form, &$form_state) {
   $window = variable_get('contact_threshold_window', 3600);
   if (!flood_is_allowed('contact', $limit, $window) && !user_access('administer contact forms')) {
     drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.", array('%limit' => $limit, '@interval' => format_interval($window))), 'error');
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
     drupal_exit();
   }
 
@@ -183,7 +183,7 @@ function contact_personal_form($form, &$form_state, $recipient) {
   $window = variable_get('contact_threshold_window', 3600);
   if (!flood_is_allowed('contact', $limit, $window) && !user_access('administer contact forms') && !user_access('administer users')) {
     drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.", array('%limit' => $limit, '@interval' => format_interval($window))), 'error');
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
     drupal_exit();
   }
 
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index 3edf83c..e5665a6 100644
--- a/core/modules/image/image.module
+++ b/core/modules/image/image.module
@@ -691,7 +691,7 @@ function image_style_deliver($style, $scheme) {
     else {
       $headers = module_invoke_all('file_download', $image_uri);
       if (in_array(-1, $headers) || empty($headers)) {
-        return drupal_access_denied();
+        throw new AccessDeniedHttpException();
       }
       if (count($headers)) {
         foreach ($headers as $name => $value) {
diff --git a/core/modules/menu/menu.admin.inc b/core/modules/menu/menu.admin.inc
index 2e1725d..4e58e45 100644
--- a/core/modules/menu/menu.admin.inc
+++ b/core/modules/menu/menu.admin.inc
@@ -506,7 +506,7 @@ function menu_delete_menu_page($menu) {
   // System-defined menus may not be deleted.
   $system_menus = menu_list_system_menus();
   if (isset($system_menus[$menu['menu_name']])) {
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
     return;
   }
   return drupal_get_form('menu_delete_menu_confirm', $menu);
@@ -616,7 +616,7 @@ function menu_item_delete_page($item) {
   // Links defined via hook_menu may not be deleted. Updated items are an
   // exception, as they can be broken.
   if ($item['module'] == 'system' && !$item['updated']) {
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
     return;
   }
   return drupal_get_form('menu_item_delete_form', $item);
diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index 9010f90..35192a6 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -775,5 +775,5 @@ function shortcut_link_add_inline($shortcut_set) {
     drupal_goto();
   }
 
-  return drupal_access_denied();
+  throw new AccessDeniedHttpException();
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index fc0e8bb..5a6a52a 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -278,7 +278,7 @@ function system_theme_enable() {
     }
     drupal_goto('admin/appearance');
   }
-  return drupal_access_denied();
+  throw new AccessDeniedHttpException();
 }
 
 /**
@@ -306,7 +306,7 @@ function system_theme_disable() {
     }
     drupal_goto('admin/appearance');
   }
-  return drupal_access_denied();
+  throw new AccessDeniedHttpException();
 }
 
 /**
@@ -353,7 +353,7 @@ function system_theme_default() {
     }
     drupal_goto('admin/appearance');
   }
-  return drupal_access_denied();
+  throw new AccessDeniedHttpException();
 }
 
 /**
@@ -2301,7 +2301,7 @@ function system_batch_page() {
   $output = _batch_page();
 
   if ($output === FALSE) {
-    drupal_access_denied();
+    throw new AccessDeniedHttpException();
   }
   elseif (isset($output)) {
     // Force a page without blocks or messages to
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
index 300bbc1..57333e6 100644
--- a/core/modules/user/user.pages.inc
+++ b/core/modules/user/user.pages.inc
@@ -157,7 +157,7 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
     else {
       // Deny access, no more clues.
       // Everything will be in the watchdog's URL for the administrator to check.
-      drupal_access_denied();
+      throw new AccessDeniedHttpException();
     }
   }
 }
@@ -480,7 +480,7 @@ function user_cancel_confirm($account, $timestamp = 0, $hashed_pass = '') {
       drupal_goto("user/$account->uid/cancel");
     }
   }
-  drupal_access_denied();
+  throw new AccessDeniedHttpException();
 }
 
 /**
