-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add overriden NotFoundHttpException to have access to the original re…
…sponse when converting 404
- Loading branch information
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace eZ\Bundle\EzPublishLegacyBundle\Exception; | ||
|
||
use eZ\Bundle\EzPublishLegacyBundle\LegacyResponse; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException as BaseNotFoundHttpException; | ||
|
||
class NotFoundHttpException extends BaseNotFoundHttpException | ||
{ | ||
/** | ||
* @var \eZ\Bundle\EzPublishLegacyBundle\LegacyResponse | ||
*/ | ||
protected $originalResponse; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param string $message | ||
* @param \eZ\Bundle\EzPublishLegacyBundle\LegacyResponse $originalResponse | ||
*/ | ||
public function __construct($message, LegacyResponse $originalResponse = null) | ||
{ | ||
parent::__construct($message); | ||
|
||
$this->originalResponse = $originalResponse; | ||
} | ||
|
||
/** | ||
* Returns the response. | ||
* | ||
* @return \eZ\Bundle\EzPublishLegacyBundle\LegacyResponse | ||
*/ | ||
public function getOriginalResponse() | ||
{ | ||
return $this->originalResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters