[MAGNOLIA-6445] Don't swallow exceptions in Op.exec() / doInSystemContext Created: 18/Nov/15 Updated: 04/Mar/19 |
|
| Status: | Open |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 5.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Magnolia International | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | system-context | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
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) exampleThis 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. Test added in |
| Comments |
| Comment by Mikaël Geljić [ 18/Nov/15 ] |
|
efochr I believe what Greg was telling us was not to specifically prevent NPEs on GuiceUtils, but rather make sure we don't swallow exceptions in the first place. Then that NPE should not occur anymore to start with. Changing the type of exception thrown in GuiceUtils is just a side-issue that "would have helped", for the example (improving the symptoms). |