FIX: Make error messages available to extensions

This commit is contained in:
Jonathon Menz 2018-06-05 14:09:37 -07:00
parent 73c6c61ff7
commit bf07ba30f4

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