Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method App\View\Cell\WhateverCell::__toString() must not throw an exception #7

Open
gtrias opened this issue Jul 22, 2015 · 4 comments

Comments

@gtrias
Copy link

gtrias commented Jul 22, 2015

I'm having this error with WhoopsHandler, note that with default Cakephp 3 ErrorHandler I can see the trigger_error rised by Cell __toString() method. I'm not sure if the error is from the plugin or the Whoops library itself but I post here because is related with cakephp as well.

This error makes very hard to debug errors on Cell's templates.

To reproduce the error create a cell and on its display.ctp write the next:

<?php

$somearray = array('testing' => 'values');

// then try to echo 
echo $somearray;

Some useful information about this error:

http://stackoverflow.com/questions/2429642/why-its-impossible-to-throw-exception-from-tostring
http://www.phpsadness.com/sad/14

@jadb
Copy link
Member

jadb commented Jul 23, 2015

Interesting...

What's your PHP's error level? Could be related to that since Whoops I believe catches triggered errors, not just thrown exceptions.

@gtrias
Copy link
Author

gtrias commented Jul 23, 2015

My PHP error level is 24575.

Which error level should I have?

@elboletaire
Copy link

It does not just occur with Cells. I'm having a similar issue with a custom AuthComponent (which also loads custom authenticators, password hashers and custom authorize classes).

Using the default CakePHP error handler shows all the stack and a clear error, whilst using this whoops plugin only shows a PHP7ErrorException:

cakephp error handler

whoops plugin

@dereuromark
Copy link

dereuromark commented Jan 19, 2018

@elboletaire Sounds also like Middleware is a different handler than the low level one.
https://github.com/dereuromark/cakephp-whoops should fix things for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants