class ErrorContainer

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer
  2. 10 core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer
  3. 8.9.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer

Container base class which triggers an error.

Hierarchy

Expanded class hierarchy of ErrorContainer

File

core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php, line 10

Namespace

Drupal\FunctionalTests\Bootstrap
View source
class ErrorContainer extends Container {
  
  /**
   * {@inheritdoc}
   */
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
    if ($id === 'http_kernel') {
      // Enforce a recoverable error.
      $callable = function (ErrorContainer $container) {
      };
      return $callable(1);
    }
    return parent::get($id, $invalidBehavior);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.