class RedirectLoopException in Redirect 8
Exception for when a redirect loop is detected.
Hierarchy
- class \Drupal\redirect\Exception\RedirectLoopException extends \Drupal\redirect\Exception\RuntimeException
Expanded class hierarchy of RedirectLoopException
3 files declare their use of RedirectLoopException
- RedirectAPITest.php in tests/
src/ Kernel/ RedirectAPITest.php - RedirectRepository.php in src/
RedirectRepository.php - RedirectRequestSubscriber.php in src/
EventSubscriber/ RedirectRequestSubscriber.php
File
- src/
Exception/ RedirectLoopException.php, line 10
Namespace
Drupal\redirect\ExceptionView source
class RedirectLoopException extends \RuntimeException {
/**
* The looping path.
*
* @var string
*/
protected $path;
/**
* The redirect ID.
*
* @var int
*/
protected $rid;
/**
* Formats a redirect loop exception message.
*
* @param string $path
* The path that results in a redirect loop.
* @param int $rid
* The redirect ID that is involved in a loop.
*/
public function __construct($path, $rid) {
$message = new FormattableMarkup('Redirect loop identified at %path for redirect %rid', [
'%path' => $path,
'%rid' => $rid,
]);
$this->path = $path;
$this->rid = $rid;
parent::__construct($message);
}
/**
* Returns the looping path.
*
* @return string
* The path.
*/
public function getPath() {
return $this->path;
}
/**
* Returns the redirect ID.
*
* @return int
* The redirect ID.
*
*/
public function getRedirectId() {
return $this->rid;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RedirectLoopException:: |
protected | property | The looping path. | |
RedirectLoopException:: |
protected | property | The redirect ID. | |
RedirectLoopException:: |
public | function | Returns the looping path. | |
RedirectLoopException:: |
public | function | Returns the redirect ID. | |
RedirectLoopException:: |
public | function | Formats a redirect loop exception message. |