class EnforcedResponseException in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Form/EnforcedResponseException.php \Drupal\Core\Form\EnforcedResponseException
- 9 core/lib/Drupal/Core/Form/EnforcedResponseException.php \Drupal\Core\Form\EnforcedResponseException
Custom exception to break out of the main request and enforce a response.
Hierarchy
- class \Drupal\Core\Form\EnforcedResponseException extends \Drupal\Core\Form\Exception
Expanded class hierarchy of EnforcedResponseException
5 files declare their use of EnforcedResponseException
- authorize.php in core/
authorize.php - Administrative script for running authorized file operations.
- BigPipeResponseAttachmentsProcessor.php in core/
modules/ big_pipe/ src/ Render/ BigPipeResponseAttachmentsProcessor.php - FieldBlockTest.php in core/
modules/ layout_builder/ tests/ src/ Kernel/ FieldBlockTest.php - FormBuilderTest.php in core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php - Contains \Drupal\Tests\Core\Form\FormBuilderTest.
- HtmlResponseAttachmentsProcessor.php in core/
lib/ Drupal/ Core/ Render/ HtmlResponseAttachmentsProcessor.php
File
- core/
lib/ Drupal/ Core/ Form/ EnforcedResponseException.php, line 10
Namespace
Drupal\Core\FormView source
class EnforcedResponseException extends \Exception {
/**
* The response to be enforced.
*
* @var \Symfony\Component\HttpFoundation\Response
*/
protected $response;
/**
* Constructs a new enforced response exception.
*
* @param \Symfony\Component\HttpFoundation\Response $response
* The response to be enforced.
* @param string $message
* (optional) The exception message.
* @param int $code
* (optional) A user defined exception code.
* @param \Exception $previous
* (optional) The previous exception for nested exceptions
*/
public function __construct(Response $response, $message = "", $code = 0, \Exception $previous = NULL) {
parent::__construct($message, $code, $previous);
$this->response = $response;
}
/**
* Return the response to be enforced.
*
* @returns \Symfony\Component\HttpFoundation\Response $response
* The response to be enforced.
*/
public function getResponse() {
return $this->response;
}
}