[MGNLUI-2819] No trace in logs when a Vaadin internal error occurs (e.g. PaintException) Created: 23/Apr/14  Updated: 08/May/14  Resolved: 23/Apr/14

Status: Closed
Project: Magnolia UI
Component/s: admincentral
Affects Version/s: 5.2.4
Fix Version/s: 5.2.5, 5.3

Type: Task Priority: Major
Reporter: Mikaël Geljić Assignee: Mikaël Geljić
Resolution: Fixed Votes: 0
Labels: errorhandling
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
caused by MGNLUI-1139 As a user, I'm properly warned and gu... Closed
supersession
supersedes MGNLUI-2537 Cause of Vaadin-"Internal Errors" are... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Sprint: 5.3 Sprint 6

 Description   

Up till now (see original ticket), we (I) disabled VaadinSession's default error handler by setting it to null.

This was probably done so that only our own error handler (which is registered on the UI, not the session) deals with Vaadin errors, avoiding the big fat red boxes. Our AdmincentralErrorHandler sends message to the pulse.

Now, although it doesn't even prevent the big fat red boxes to show up, it has the definite disadvantage to swallow Vaadin internal errors like PaintExceptions — those that are obviously not handled at UI level, because they occur while the UIDL response is being written.

We need to either restore the session-level DefaultErrorHandler, which is enough for the exceptions to appear in the logs, or add a specific handler of our own instead. Just anything but null really.



 Comments   
Comment by Mikaël Geljić [ 23/Apr/14 ]

Check out branch "error-handling", in there you'll find an additional subapp for the sample app (commits marked as DO NOT MERGE!!!).
It needs to be bootstrapped and can only be opened via location e.g. http://localhost:8080/magnolia-bundled-webapp/.magnolia/admincentral#app:sample:error;

From there you can fire NPEs at two different phases:

  • Red button
    fires NPE during update phase; doesn't crash the session; is handled by AdmincentralErrorHandler and sends a message to the pulse.
  • Death button
    fires NPE during paint phase; crashes UIDL response and current application state; results in Vaadin 'Internal error'; as expected, simple refresh (without ?restartApplication) results in the 500 page.
Comment by Magnolia International [ 24/Apr/14 ]

I guess we could actually merge that error sample subapp. Here's a challenge for you: write a ui test for this ?
(I'm concerned the behavior we change by simply removing the line in AdmincentralPresenter isn't documented, since there's no code to leave an inline comment about, or tested, so we'd accidentally re-introduce that "bug" at some other point). Well, perhaps a simple inline comment where we set the AdmincentralErrorHandler, or in AdmincentralErrorHandler itself, would already help (understanding the distinction between the 2 error handlers)

Generated at Mon Feb 12 09:00:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.