-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
5.4.2
When an exception occurs in Op.exec() or even potentially in MgnlContext.getSystemContext(), AND MgnlContext.release() ALSO fails, the former exception is lost; neither logged nor thrown.
IMO, the former exception is the one we want to be throwing, and a further exception in release should be ignored (but logged anyway)
example
This happens a lot, btw, especially during development, since we start components/guice through a doInSystemContext call from MagnoliaServletContextListener; any misconfigured or missing component, wrong constructor, etc, just results in NPE in info.magnolia.objectfactory.guice.GuiceUtils#hasExplicitBindingFor because of this.
(FYI see attached patch; I believe if this error here gets fixed, the NPE won't happen again, however, having an explicit exception rather than an NPE would have helped as well).
Test added in MAGNOLIA-6363 is also questionable. It seems overly complicated and undocumented. At the very least, it should say what it does/why (i understand there's probably no easy way to test those pesky static methods).
- relates to
-
MAGNOLIA-6363 Unclosed sessions on doInSystemContext op.exec() failures
- Closed