-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Milestone
Description
This is a (multiple allowed):
-
bug
-
enhancement
-
feature-discussion (RFC)
-
CakePHP Version: 3.5.3
-
Platform and Target: PHP7
What you did
Declare the following controller:
class TestsController extends AppController
{
public function exception() {
throw new \Exception();
}
public function error() {
throw new \Error();
}
}Access /tests/exception and /tests/error.
What happened
While Exceptions are handled by ErrorHandlerMiddleware::handleException(), PHP7 Errors are handled by ErrorHandler::handleException().
What you expected to happen
Both Exceptions and PHP7 Errors are handled by ErrorHandlerMiddleware::handleException() if ErrorHandlerMiddleware is enabled.
Related code
cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php
Lines 92 to 99 in 35f70ad
| public function __invoke($request, $response, $next) | |
| { | |
| try { | |
| return $next($request, $response); | |
| } catch (Exception $e) { | |
| return $this->handleException($e, $request, $response); | |
| } | |
| } |
Related issues
inoas