Fix catch \Throwable to prevent silent PHP 8 failures - #60
Open
manuel-be-one wants to merge 1 commit into
Open
Conversation
Replace catch (\Exception) with catch (\Throwable) . On PHP 8, type violations raise TypeError or Error (subclasses of \Throwable, not \Exception), which were not caught causing the sync process to die mid-flight, leave progress locks unreleased, and freeze the UI at 25% with no error message. Also, treat progress locks older than 10 minutes as stale (orphaned by a crashed process), clear them, and allow a new pull to start.
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.
✍️ Description
💡 What does this PR do?
catch (\Exception)withcatch (\Throwable)inpull.php,push.php, andbase.phpsync entry points$e->get_data()behindmethod_exists()since native PHPErrorclasses do not implement this methoderror_log()with file and line context in all catch blocks (replaces the silent// @todo logging?inset_post_values)maybe_trigger_new_pull()in theelseif (prev > current)polling branch so a crashed item no longer blocks the entire queue❓ Why are we doing this?
On PHP 8, type violations raise
TypeErrororError, subclasses of\Throwable, not\Exception. These were not caught, causing the sync process to die mid-flight: progress locks were never released, and the UI would freeze at 25% indefinitely with no error message shown to the user.The stale lock cleanup is a safety net for any process that crashes before these catches can handle it.
