finalizing preferred refactoring
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / datasource / wizard / CdmDataSourceH2WizardPage.java
index 34f6577692bd918ac12c2f74b856531519b34637..183e3e8717e9b96ed363e8ebc16d2bb535aa3839 100644 (file)
@@ -51,11 +51,12 @@ public class CdmDataSourceH2WizardPage extends CdmDataSourceCredentialsWizardPag
                                getWizard().getPassword()
                        );
                
-               if (dataSource.testConnection()) {
+               try{
+                       dataSource.testConnection();
                        MessageDialog.openConfirm(parent.getShell(), "Test successful", "Test successful");
-               } else {
-                       MessageDialog.openWarning(parent.getShell(), "Test unsuccessful", "Test unsuccessful");
-               }               
+               } catch(Exception e){
+                       MessageDialog.openWarning(parent.getShell(), "Test unsuccessful", "Test unsuccessful \n\n" + e.getCause());
+               }       
        }
 
        /* (non-Javadoc)