Closed (works as designed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Aug 2015 at 15:02 UTC
Updated:
26 May 2025 at 18:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
znerol commentedComment #3
znerol commentedOk, seems that this is not so easy. If there is a mismatch between the dumped container and an updated class (e.g., changed type hints), then the exception (or is it an error?) is thrown during service instantiation. I.e., it would be necessary to override
Container::get(), catch, wrap and rethrow any exceptions from there. But that method is obviously in the critical path.Example bt:
Comment #4
znerol commentedIn case of PHP errors, it is obviously necessary to handle that in the error handler.
Maybe examine the backtrace and try to guess if the origin was a service instantiation - but that's a bit too fragile for my taste.
Comment #5
znerol commentedI think that even before #2509898: Additional uncaught exception thrown while handling exception after service changes, the rebuild-message wasn't always displayed when the compiled container got out of date. I tried some things with commit 883c209 and it seems to me that the message only appeared when things were seriously screwed up in the bootstrap or the render pipeline. But if a higher level service has issues, then a Recoverable fatal error appears. For example, when breaking the entity form builder (see diff), then the result is the message shown in the attached screenshot.
The only way I found so far to provoke the rebuild-message with the aforementioned commit is to simply stop the database. In that case, the error handler freaks out because of the reasons discussed in the other issue.
That said I'm not sure whether we can actually present a meaningful message if things are screwed up in the compiled container - but I'm pretty sure that the rebuild-message we removed in #2521852: Make it possible to use your own exception handler never really worked as intended.
Comment #19
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #20
znerol commented