diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index cbb4e2f..71b4a2d 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -1188,8 +1188,16 @@ protected function getContainerBuilder() { * TRUE if the container was successfully cached. */ protected function cacheDrupalContainer($container_definition) { - // -1 == Cache::Permanent, hardcoded for performance reasons. - return $this->bootstrapContainer->get('cache.container')->set($this->getCacheKey(), $container_definition, -1, ['container']); + $saved = TRUE; + try { + // -1 == Cache::Permanent, hardcoded for performance reasons. + $this->bootstrapContainer->get('cache.container')->set($this->getCacheKey(), $container_definition, -1, ['container']); + } + catch (\Exception $e) { + $saved = FALSE; + } + + return $saved; } /**