ExceptionContainer.php in Drupal 10
File
core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php
View source
<?php
namespace Drupal\FunctionalTests\Bootstrap;
use Drupal\Core\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ExceptionContainer extends Container {
public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object {
if ($id === 'http_kernel') {
throw new \Exception('Thrown exception during Container::get');
}
else {
return parent::get($id, $invalidBehavior);
}
}
}