Page MenuHomePhabricator

Remove custom 'CatchableFatalErrorException' logic from Echo/Flow code bases
Open, Needs TriagePublic

Description

There is a custom PHP error handler installed in both Echo and Flow around certain hook handlers. The handler converts would-be fatal exceptions of type E_RECOVERABLE_ERROR and throws Flow\Exception\CatchableFatalErrorException instead. This happens for undefined classes, or argument types, etc.

It is unclear why this is and also seems "surprising" from a debugging perspective in part because it is not limited to Flow/Echo scope, but also affects all other code executed from core and from extensions that may run from an Echo/Flow class invocation.

I would propose removing these custom error handling in favour of MediaWiki core's error handler handling these instead. Which means that in the case of core or Echo/Flow code having a problem relating to an undefined class or a argument type mis-match, it will produce a fatal error, as one would expect elsewhere.

Alternatively, if there is a logical dependency on this mechanism, we may want to bring that to TechCom and find another way that addresses the same underlying needs with a solution that works for everyone :)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 476376 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Flow@master] Consistently call restore_error_handler() from finally { }

https://gerrit.wikimedia.org/r/476376

Change 476376 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Consistently call restore_error_handler() from finally { }

https://gerrit.wikimedia.org/r/476376

Moving to the radar for now on the assumption this would likely be removed. If you find there's something relying on it or would otherwise like to keep it, that's cool, just swing it back to our Inbox so we reconsider and maybe weigh options etc.