Issue Details (XML | Word | Printable)

Key: IZPACK-318
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Julien Ponge
Reporter: Christian d'Heureuse
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IzPack

GUIInstaller constructor should display a message box when an exception occurs

Created: 05/Mar/09 08:48 AM   Updated: 20/Apr/09 03:26 AM   Resolved: 23/Mar/09 01:56 PM
Return to search
Component/s: Installer
Affects Version/s: 4.2.1
Fix Version/s: 4.3.0

Time Tracking:
Not Specified

File Attachments: 1. Text File IZPACK-318-Destroyer.patch (1.0 kB)
2. Text File IZPACK-318-GuiInstaller.patch (1 kB)

Environment: Graphical UI


 Description  « Hide

When an exception occurs within the GUIInstaller constructor, e.g. NoClassDefFoundError, the error is displayed at the console but no message box occurs. When the installer is started by e.g. double-clicking at the JAR file in Windows, no error message can be seen and it seems like nothing happens.

I suggest to move the current GUIInstaller constructor code into an init() subroutine and change the constructor to something like that:

public GUIInstaller() throws Throwable {
try { init(); } // call original constructor code
catch (Throwable e) { // catch Throwables so that e.g. NoClassDefFoundError is included
try { // try to display a message box JOptionPane.showMessageDialog (null, "Error: "+e.toString(), "Error", JOptionPane.ERROR_MESSAGE); }
catch (Exception e2) {} // ignore possible exception from showMessageDialog
throw e; }} // re-throw the original exception



Julien Ponge made changes - 05/Mar/09 01:02 PM
Field Original Value New Value
Fix Version/s 4.3.0 [ 14763 ]
Christian d'Heureuse added a comment - 06/Mar/09 05:09 PM

A similar problem also exists in the uninstaller.

When a NoClassDefFoundError occurs in Destroyer.getListenerLists(), no error message is displayed at the GUI.

Destroyer.run() should not only catch "Exception"s, but also "Throwable"s or at least "Error"s.


Julien Ponge added a comment - 15/Mar/09 09:21 AM

Ok Christian.

Can you please submit a patch for the issue?

Thanks


Julien Ponge made changes - 15/Mar/09 09:21 AM
Assignee Julien Ponge [ jponge ]
Christian d'Heureuse added a comment - 23/Mar/09 01:42 PM

Added patches for GuiInstaller.java and Destroyer.java.

(I additionally cleaned out some unnecessary code in Destroyer.java)


Christian d'Heureuse made changes - 23/Mar/09 01:42 PM
Attachment IZPACK-318-Destroyer.patch [ 40890 ]
Attachment IZPACK-318-GuiInstaller.patch [ 40889 ]
Julien Ponge added a comment - 23/Mar/09 01:56 PM

Great!

Thanks a lot.


Julien Ponge made changes - 23/Mar/09 01:56 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Julien Ponge made changes - 20/Apr/09 03:26 AM
Status Resolved [ 5 ] Closed [ 6 ]