.../DefaultExceptionHtmlSubscriber.php | 4 ++--
.../EventSubscriber/ExceptionJsonSubscriber.php | 1 -
.../Core/Http/Exception/CacheableHttpException.php | 24 ++++++++++++++++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
index 1e5df6d..0ffd5a8 100644
--- a/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php
@@ -2,8 +2,8 @@
namespace Drupal\Core\EventSubscriber;
+use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Cache\CacheableResponseInterface;
-use Drupal\Core\Cache\Exception\CacheableHttpExceptionInterface;
use Drupal\Core\Routing\RedirectDestinationInterface;
use Drupal\Core\Utility\Error;
use Psr\Log\LoggerInterface;
@@ -173,7 +173,7 @@ protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $st
}
// Persist the exception's cacheability metadata, if any.
- if ($response instanceof CacheableResponseInterface && $exception instanceof CacheableHttpExceptionInterface) {
+ if ($response instanceof CacheableResponseInterface && $exception instanceof CacheableDependencyInterface) {
$response->addCacheableDependency($exception->getCacheableMetadata());
}
diff --git a/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
index 620ad1b..239e582 100644
--- a/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php
@@ -4,7 +4,6 @@
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Cache\CacheableJsonResponse;
-use Drupal\Core\Http\Exception\CacheableHttpExceptionInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
diff --git a/core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php b/core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php
new file mode 100644
index 0000000..76f529e
--- /dev/null
+++ b/core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php
@@ -0,0 +1,24 @@
+setCacheability($cacheability);
+ parent::__construct($statusCode, $message, $previous, $code);
+ }
+
+}