pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Whitcomb (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIVOT-916) Replace DesktopApplicationContext.displayException calls with ApplicationContext.handleUncaughtException
Date Wed, 10 Sep 2014 23:45:34 GMT

     [ https://issues.apache.org/jira/browse/PIVOT-916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Roger Whitcomb updated PIVOT-916:
    Attachment: 916.diff

Proposed change:  just move the code from inside "handleUncaughtException" to its own method
"defaultUncaughtExceptionHandler" so it can be called from user application if desired.

My implementation looks like this:
	public void uncaughtExceptionThrown(Exception exception) {
	    try {
		MessageDialog.showException(mainWindow, exception);
	    catch (Exception ourProblem) {
		// Ignore this exception (essentially spurious problem in our code)
		// and display the original one via the default handler

> 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: Roger Whitcomb
>             Fix For: 2.0.4, 2.1, 2.0.5
>         Attachments: 916.diff, ScriptApplication.java.patch, app_exception.patch, 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 was sent by Atlassian JIRA

View raw message