diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc
index aedde16..3fe6adb 100644
--- a/core/modules/book/book.pages.inc
+++ b/core/modules/book/book.pages.inc
@@ -6,7 +6,7 @@
  */
 
 use Drupal\node\Node;
-
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 /**
  * Page callback: Prints a listing of all books.
  *
@@ -53,7 +53,7 @@ function book_export($type, $nid) {
   }
   else {
     drupal_set_message(t('Unknown export format.'));
-    drupal_not_found();
+    throw new NotFoundHttpException();
   }
 }
 
@@ -84,7 +84,7 @@ function book_export_html($nid) {
       return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth']));
     }
     else {
-      drupal_not_found();
+      throw new NotFoundHttpException();
     }
   }
   else {
diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc
index 9eabe13..4329492 100644
--- a/core/modules/comment/comment.admin.inc
+++ b/core/modules/comment/comment.admin.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\comment\Comment;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Page callback: Presents an administrative comment listing.
@@ -260,7 +261,7 @@ function comment_confirm_delete_page($cid) {
   if ($comment = comment_load($cid)) {
     return drupal_get_form('comment_confirm_delete', $comment);
   }
-  drupal_not_found();
+  throw new NotFoundHttpException();
 }
 
 /**
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 58ea4a6..4fa8fee 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -10,6 +10,7 @@
  */
 
 use Drupal\node\Node;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Comment is awaiting approval.
@@ -506,7 +507,7 @@ function comment_permalink($cid) {
     $_GET['page'] = $page;
     return menu_execute_active_handler('node/' . $node->nid, FALSE);
   }
-  drupal_not_found();
+  throw new NotFoundHttpException();
 }
 
 /**
diff --git a/core/modules/comment/comment.pages.inc b/core/modules/comment/comment.pages.inc
index 2986d13..39b8a24 100644
--- a/core/modules/comment/comment.pages.inc
+++ b/core/modules/comment/comment.pages.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\node\Node;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Form constructor for the comment reply form.
@@ -122,5 +123,5 @@ function comment_approve($cid) {
     drupal_set_message(t('Comment approved.'));
     drupal_goto('node/' . $comment->nid);
   }
-  drupal_not_found();
+  throw new NotFoundHttpException();
 }
diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc
index bf096a7..851f0bc 100644
--- a/core/modules/contact/contact.pages.inc
+++ b/core/modules/contact/contact.pages.inc
@@ -5,6 +5,8 @@
  * Page callbacks for the Contact module.
  */
 
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
 /**
  * Form constructor for the site-wide contact form.
  *
@@ -41,7 +43,7 @@ function contact_site_form($form, &$form_state) {
       drupal_set_message(t('The contact form has not been configured. <a href="@add">Add one or more categories</a> to the form.', array('@add' => url('admin/structure/contact/add'))), 'error');
     }
     else {
-      drupal_not_found();
+      throw new NotFoundHttpException();
       drupal_exit();
     }
   }
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index c124b9e..988ac21 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -5,6 +5,8 @@
  * Administration functions for language.module.
  */
 
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
 /**
  * User interface for the language overview screen.
  */
@@ -375,7 +377,7 @@ function language_admin_delete_form($form, &$form_state, $language) {
   $languages = language_list();
 
   if (!isset($languages[$langcode])) {
-    drupal_not_found();
+    throw new NotFoundHttpException();
     drupal_exit();
   }
   else {
diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc
index 8f26052..3b2d2ab 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -5,6 +5,8 @@
  * Interface translation summary, editing and deletion user interfaces.
  */
 
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
 /**
  * String search screen.
  */
@@ -511,7 +513,7 @@ function locale_translate_delete_page($lid) {
     return drupal_get_form('locale_translate_delete_form', $source);
   }
   else {
-    return drupal_not_found();
+    throw new NotFoundHttpException();
   }
 }
 
diff --git a/core/modules/openid/tests/openid_test.module b/core/modules/openid/tests/openid_test.module
index 4481818..89f3ddf 100644
--- a/core/modules/openid/tests/openid_test.module
+++ b/core/modules/openid/tests/openid_test.module
@@ -22,6 +22,7 @@
 
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Implements hook_menu().
@@ -98,7 +99,7 @@ function openid_test_yadis_xrds() {
     // that the XRI has been properly encoded. The "+" sign in the _xrd_r query
     // parameter is decoded to a space by PHP.
     if (arg(3) == 'xri' && (arg(4) != '@example*résumé;%25' || $_GET['_xrd_r'] != 'application/xrds xml')) {
-      drupal_not_found();
+      throw new NotFoundHttpException();
     }
     $output = '<?xml version="1.0" encoding="UTF-8"?>
       <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)" xmlns:openid="http://openid.net/xmlns/1.0">
diff --git a/core/modules/statistics/statistics.admin.inc b/core/modules/statistics/statistics.admin.inc
index 87ae6a5..4205aac 100644
--- a/core/modules/statistics/statistics.admin.inc
+++ b/core/modules/statistics/statistics.admin.inc
@@ -5,6 +5,8 @@
  * Admin page callbacks for the Statistics module.
  */
 
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
 /**
  * Page callback: Displays the "recent hits" page.
  *
@@ -264,7 +266,7 @@ function statistics_access_log($aid) {
     return $build;
   }
   else {
-    drupal_not_found();
+    throw new NotFoundHttpException();
   }
 }
 
diff --git a/core/modules/statistics/statistics.pages.inc b/core/modules/statistics/statistics.pages.inc
index 1b776d1..b271038 100644
--- a/core/modules/statistics/statistics.pages.inc
+++ b/core/modules/statistics/statistics.pages.inc
@@ -5,6 +5,8 @@
  * User page callbacks for the Statistics module.
  */
 
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
 /**
  * Page callback: Displays statistics for a node.
  *
@@ -106,6 +108,6 @@ function statistics_user_tracker() {
     return $build;
   }
   else {
-    drupal_not_found();
+    throw new NotFoundHttpException();
   }
 }
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 09ef3f5..519500e 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1,6 +1,7 @@
 <?php
 
 use Drupal\Core\Database\Query\SelectInterface;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * @file
@@ -2333,7 +2334,7 @@ function user_view_page($account) {
   }
   // An administrator may try to view a non-existent account,
   // so we give them a 404 (versus a 403 for non-admins).
-  drupal_not_found();
+  throw new NotFoundHttpException();
 }
 
 /**
