mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8139 from jonom/4-httperror
FIX: Make custom error messages available to extensions
This commit is contained in:
commit
b20100c2f6
@ -514,10 +514,10 @@ class RequestHandler extends ViewableData
|
||||
$request = $this->getRequest();
|
||||
|
||||
// Call a handler method such as onBeforeHTTPError404
|
||||
$this->extend("onBeforeHTTPError{$errorCode}", $request);
|
||||
$this->extend("onBeforeHTTPError{$errorCode}", $request, $errorMessage);
|
||||
|
||||
// Call a handler method such as onBeforeHTTPError, passing 404 as the first arg
|
||||
$this->extend('onBeforeHTTPError', $errorCode, $request);
|
||||
$this->extend('onBeforeHTTPError', $errorCode, $request, $errorMessage);
|
||||
|
||||
// Throw a new exception
|
||||
throw new HTTPResponse_Exception($errorMessage, $errorCode);
|
||||
|
Loading…
Reference in New Issue
Block a user