There are places in the CMS where error conditions are raised and those errors are silently ignored. This can result in either an API appearing to behave correctly (as was the case with JMail before 3.5.1), the API making it easier for fatal errors to occur, or making debugging error states difficult because the error condition is masked. Examples of this include the getMenu()
, getPathway()
, and getRouter()
methods of JApplicationCms
in which if an Exception is thrown when trying to retrieve these objects the error is discarded and a null value is returned instead. A downstream consumer not checking $menu === null
could try to use the expected JMenu
object and trigger a fatal error trying to call a method on a non-object, whereas if an exception is thrown (either from the getters or just not catch any exceptions thrown by the underlying called methods), a developer can catch an error state and act on it with debug data and if this exception goes unhandled instead of a WSOD or PHP Fatal Error you'd at least end up on Joomla's error page.
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Nope. There are some places where it can/will be argued that removing the catch (Exception $e) { return null; }
blocks in some of these methods will introduce B/C breaks so I'm not going to get into that fight until someone finally opens a 4.0 branch. Not like things can get any more broken than they are in those error conditions, but useful error messages would be nice.
Labels |
Added:
?
|
OK moving to Re-evaluate for v4
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-12-11 21:18:23 |
Closed_By | ⇒ | mbabker |
Is this very valuable improvement have been moved into J 4.0 ? I would like to follow it and help to test it, if I can.
@mbabker have your subsequent PRs closed this?