diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 9e693f5..6b87989 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -15,6 +15,7 @@
  */
 
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Timer;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Batch\Percentage;
@@ -24,6 +25,7 @@
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Renders the batch processing page based on the current state of the batch.
@@ -44,8 +46,7 @@ function _batch_page(Request $request) {
   if (!$batch) {
     $batch = \Drupal::service('batch.storage')->load($request_id);
     if (!$batch) {
-      drupal_set_message(t('No active batch.'), 'error');
-      return new RedirectResponse(\Drupal::url('<front>', [], ['absolute' => TRUE]));
+      throw new NotFoundHttpException(String::format('Page controller for batch %id requested, but batch was not found.', array('%id' => $request_id)));
     }
   }
   // Restore safe strings from previous batches.
