Merge pull request #8139 from jonom/4-httperror

FIX: Make custom error messages available to extensions
This commit is contained in:
Damian Mooyman 2018-06-06 14:18:10 +12:00 committed by GitHub
commit b20100c2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);