Fix/log fatal error - #2521
Open
Daniel-KM wants to merge 3 commits into
Open
Fix/log fatal error#2521Daniel-KM wants to merge 3 commits into
Daniel-KM wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Improves diagnosability by ensuring fatal/unhandled errors are more consistently recorded in logs across the MVC app, error pages, and synchronous jobs.
Changes:
- Trigger view events on error/404 pages by falling back to an error identifier in the
Triggerview helper. - Expand fatal error detection in synchronous job shutdown handling to include additional fatal error types.
- Register a global shutdown handler during bootstrap to log uncaught fatal PHP errors via the standard logger.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| application/src/View/Helper/Trigger.php | Triggers view events even without a route match, with special handling for error pages. |
| application/src/Job/DispatchStrategy/Synchronous.php | Broadens fatal error detection logic during shutdown for synchronous jobs. |
| application/Module.php | Adds bootstrap shutdown logging for uncaught fatal PHP errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+58
to
+61
| try { | ||
| $this->events->triggerEvent($event); | ||
| } catch (\Throwable $e) { | ||
| } |
Comment on lines
+54
to
+57
| // Log uncaught fatal php errors through the standard logger. | ||
| // Unlike mvc exceptions handled by Omeka\Mvc\ExceptionListener), fatal | ||
| // errors don't go through mvc layer, so they are only displayed and | ||
| // never recorded. |
Comment on lines
+52
to
+56
| // Fall back to the error identifier when no route matched (404, error | ||
| // page), so modules attached to "view.layout" can still observe event. | ||
| $isError = !$routeMatch; | ||
| $this->events->setIdentifiers($ids ?: [$isError ? 'Omeka\Controller\Error' : $routeMatch->getParam('controller')]); | ||
| // Avoid cascaded error or blank page hiding original failure above. |
Daniel-KM
force-pushed
the
fix/log_fatal_error
branch
from
June 22, 2026 12:24
831f5ad to
e6afffc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are some errors that are displayed only on the user screen or via the error page, but not logged, so hard to fix.