diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 08c7aff..e22bf86 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Template\Attribute;
@@ -13,6 +14,7 @@
 use Drupal\menu_link\MenuLinkStorageController;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 use Symfony\Component\Routing\Route;
 
 /**
diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php
index 752cf56..24ad5ff 100644
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Routing;
 
+use Drupal\Component\Utility\String;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\Routing\Exception\RouteNotFoundException;
 use Symfony\Component\Routing\RouteCollection;
@@ -99,7 +100,7 @@ public function getRouteCollectionForRequest(Request $request) {
     $collection = $this->getRoutesByPath($path);
 
     if (!count($collection)) {
-      throw new ResourceNotFoundException();
+      throw new ResourceNotFoundException(String::format("The route for '@path' could not be found", array('@path' => $path)));
     }
 
     return $collection;
diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php
index 3059164..5541b9f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouterPermissionTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Routing;
 
 use Drupal\simpletest\WebTestBase;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 
 /**
  * Basic tests for access permissions in routes.
@@ -33,8 +34,20 @@ public static function getInfo() {
    * Tests permission requirements on routes.
    */
   public function testPermissionAccess() {
-    $this->drupalGet('router_test/test7');
+    $path = 'router_test/test7';
+    $this->drupalGet($path);
     $this->assertResponse(403, "Access denied for a route where we don't have a permission");
+    // An invalid path should throw an exception.
+    $map = array();
+    $route = \Drupal::service('router.route_provider')->getRouteByName('router_test_7');
+    try {
+      menu_item_route_access($route, $path . 'invalid', $map);
+      $exception = FALSE;
+    }
+    catch (ResourceNotFoundException $e) {
+      $exception = TRUE;
+    }
+    $this->assertTrue($exception, 'A ResourceNotFoundException was thrown while checking access for an invalid route.');
 
     $this->drupalGet('router_test/test8');
     $this->assertResponse(403, 'Access denied by default if no access specified');
