[ 
https://issues.apache.org/jira/browse/PIVOT-916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756604#comment-13756604
 ] 

Karel Hübl commented on PIVOT-916:
----------------------------------

Hi Sandro,

The patch is for trunk revision 1513401. I am attaching archived eclipse 
project with simple unit test and testing application. 

The unit test is only testing exception handling for applicatin startup. I was 
not able implement unit test for application shutdown (there is System.exit(0) 
call in DesktopApplicationContext.HostFrame.processWindowEvent()). It also 
seems to me, that suspend() and resume() methods are not invoked during 
minimizing and activating the Pivot desktop application. This is possible 
another bug...

You can test the behaviour by executing the TestingApplication main method:
1) Execute the app
2) Click the Go button
3) Close the app

You should see these lines in system output with patched wtk trunk on classpath 
and no dialog showing after app startup:
uncaughtExceptionThrown: Exception starting up app.
uncaughtExceptionThrown: Exception performing action.
uncaughtExceptionThrown: Exception shutting down app.

You can also check, that minimizing and activating the testing app is not 
invoking suspend() and resume() methods of the testing app.


                
> Replace DesktopApplicationContext.displayException calls with 
> ApplicationContext.handleUncaughtException
> --------------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-916
>                 URL: https://issues.apache.org/jira/browse/PIVOT-916
>             Project: Pivot
>          Issue Type: Improvement
>            Reporter: Karel Hübl
>            Assignee: Sandro Martini
>             Fix For: 2.1
>
>         Attachments: trunk_wtk.patch
>
>
> There should be consistent way to handle uncaught exceptions in Pivot 
> applications. 
> However uncaught exceptions thrown in DesktopApplicationContext  class (for 
> example in application.startup ) are handled using private static method 
> displayException, which displays dialog and its logic cannot be overriden.
> May be ApplicationContext.handleUncaughtException could be made protected and 
> calls to DesktopApplicationContext.displayException could be replaced by  
> ApplicationContext.handleUncaughtException. And possibly Application.Adapter 
> could implement UncaughtExceptionHandler - so current 
> DesktopApplicationContext.displayException logic could be moved to new 
> Application.Adapter.uncaughtExceptionThrown method.
> This should enable to override uncaught exception handling globally in pivot 
> applications.
> Motivation:
> We deploy Pivot app using Java Web Start. Users have by default disabled Java 
> Console (and they are not familiar with it). We want to display custom dialog 
> to handle uncaught exceptions displaying full stack trace and with possiblity 
> to report exception to help desk.
> I think, in current implementation it is not possible to override handling of 
> uncaught exceptions thrown during application init and other specific 
> situations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to