mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
18 lines
397 B
PHP
18 lines
397 B
PHP
<?php
|
|
|
|
/**
|
|
* Enhances error handling for a controller with ErrorPage generated output
|
|
*
|
|
* @package cms
|
|
* @subpackage controller
|
|
*/
|
|
class ErrorPageControllerExtension extends Extension {
|
|
|
|
public function onBeforeHTTPError($statusCode, $request) {
|
|
$response = ErrorPage::response_for($statusCode);
|
|
if($response) {
|
|
throw new SS_HTTPResponse_Exception($response, $statusCode);
|
|
}
|
|
}
|
|
}
|