cakephp: Argument 1 passed to Cake\Error\ExceptionRenderer::__construct() must be an instance of Exception
This is a (multiple allowed):
-
bug
-
CakePHP Version: 3.5.7
-
Platform and Target: PHP 7.1.11; MariaDB 10.2.11
What you did
I write this code on the controller:
$categories = TableRegistry::get('Categories');
$category = $categories->find('all');
What happened
Gives me this error:
Argument 1 passed to Cake\Error\ExceptionRenderer::__construct() must be an instance of Exception, instance of Error given, called in /home/psantos/Workspace/my_app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php on line 167
What you expected to happen
I was expecting to get a more descriptive error info. no matter what change I do, I stil getting the same error.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (15 by maintainers)
Perhaps this patch might fix the reported issue.
BaseErrorHandlerdoes similar.IMO the bigger issue is some php7 errors to not being logged, the typehint issue is minor in comparison.
Custom error handler, see e.g. DatabaseLog plugin.