Closed weaverryan closed 2 years ago
Hm, this works fine for me i.e. the original exception is shown, and not the Undefined array key
one.
Steps taken:
composer install
enable_authenticator_manager: true
as per #28I have a new repo to try this on. AND, I think I know why you didn't see the same bad behavior as me. It is all explained in this README: https://github.com/weaverryan/netgens-layouts-playing/tree/exception_swallow
But, in short, when you "trigger" the error (which is from a bug in my code), the layouts admin page breaks (of course) and TWO Ajax requests fail in the background. One of these DOES show the correct error as JSON. The OTHER failed request shows the "bad" undefined array key error from my screenshot.
Cheers!
@weaverryan I still can't reproduce! I indeed get two errors the first time around, but both of them are "normal"
Ah, that's crazy! Well, if you still can't replicate it, then I don't think we'll be able to fix it - I can't think of what system differences would cause this (I don't have Xdebug installed... I'm not sure if that could be a difference).
Can you just pack the entire project + DB and send it to me, so I can test that way?
As we discussed, that's what the above is - that's the exact code, and even the exact database due to the migrations and fixtures. So, I think it must be triggered by some difference in our php installs/versions? I wouldn't worry about it, until someone else hits the same issue.
Allright!
I'll close this then, feel free to reopen if you have a different reproducer :)
Hi!
While editing a layout, I got this nasty error in an Ajax call:
What actually happened is that I made a mistake. The page should be showing me this error:
That's from a mistake in my code. However, it's hidden because
ExceptionSerializerListener
fails when serializing the exception on this line: https://github.com/netgen-layouts/layouts-core/blob/master/bundles/LayoutsAdminBundle/EventListener/ExceptionSerializerListener.php#L73The full stack trace is:
For some reason, when the exception is being serialized, the serialized tries to call
getMethod()
onRequestDataCollector
...$this->data
is an empty array at that point, so things explode.You should be able to repeat the error via this branch - https://github.com/weaverryan/layouts-symfony-barebones/tree/swallowed-error - then create/edit a layout.
Cheers!