diff --git a/core/modules/views/src/InvalidDisplayException.php b/core/modules/views/src/InvalidDisplayException.php
new file mode 100644
index 0000000000..d0f5674361
--- /dev/null
+++ b/core/modules/views/src/InvalidDisplayException.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Drupal\views;
+
+/**
+ * Defines an exception thrown when an invalid display ID is used.
+ */
+class InvalidDisplayException extends \Exception {
+
+}
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index b1861f7b36..eb966b6e25 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -769,6 +769,9 @@ public function getDisplay() {
    *
    * @return bool
    *   TRUE if the display was correctly set, FALSE otherwise.
+   *
+   * @throws \Drupal\views\InvalidDisplayException
+   *   Thrown when an invalid display ID is passed.
    */
   public function setDisplay($display_id = NULL) {
     // If we have not already initialized the display, do so.
@@ -788,8 +791,7 @@ public function setDisplay($display_id = NULL) {
 
     // Ensure the requested display exists.
     if (!$this->displayHandlers->has($display_id)) {
-      debug(format_string('setDisplay() called with invalid display ID "@display".', ['@display' => $display_id]));
-      return FALSE;
+      throw new InvalidDisplayException("ViewExecutable::setDisplay called with invalid display ID: $display_id");
     }
 
     // Reset if the display has changed. It could be called multiple times for
diff --git a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
index f843892e5d..f05fe67489 100644
--- a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
@@ -6,6 +6,7 @@
 use Drupal\Component\Utility\Xss;
 use Drupal\node\Entity\NodeType;
 use Drupal\views\Entity\View;
+use Drupal\views\InvalidDisplayException;
 use Drupal\views\Views;
 use Drupal\views\ViewExecutable;
 use Drupal\views\ViewExecutableFactory;
@@ -196,8 +197,12 @@ public function testSetDisplayWithInvalidDisplay() {
     $view->initDisplay();
 
     // Error is triggered while calling the wrong display.
-    $this->setExpectedException(\PHPUnit_Framework_Error::class);
-    $view->setDisplay('invalid');
+    try {
+      $view->setDisplay('invalid');
+    }
+    catch (InvalidDisplayException $e) {
+      $this->assertEquals('ViewExecutable::setDisplay called with invalid display ID: invalid', $e->getMessage());
+    }
 
     $this->assertEqual($view->current_display, 'default', 'If setDisplay is called with an invalid display id the default display should be used.');
     $this->assertEqual(spl_object_hash($view->display_handler), spl_object_hash($view->displayHandlers->get('default')));
