Show errors if package download or install fails
authorEd Swartz <ed.swartz@nokia.com>
Wed, 08 Sep 2010 17:11:16 -0500
changeset 1964 f51fb769a899
parent 1963 718df81b3480
child 1965 0dd7f79ee65d
Show errors if package download or install fails
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java	Wed Sep 08 17:09:15 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java	Wed Sep 08 17:11:16 2010 -0500
@@ -35,6 +35,7 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.layout.GridLayoutFactory;
 import org.eclipse.jface.viewers.ArrayContentProvider;
@@ -861,6 +862,9 @@
 				FileUtils.copyFile(is, file);
 			}
 		}
+		else
+			MessageDialog.openError(getShell(), "Package Error", MessageFormat.format("Cannot locate package file ({0})\n\n(server configuration problem?)", 
+					packageContents.getDefaultNameFileName()));
 	}
 	
 	private void attemptInstall(IPackageContents packageContents) throws Exception {
@@ -875,6 +879,10 @@
 			FileUtils.copyFile(is, tempFile);
 			Program.launch(tempFile.getAbsolutePath());
 		}
+		else
+			MessageDialog.openError(getShell(), "Package Error", MessageFormat.format(
+					"Failed to download package ({0})\n\n(server configuration problem?)",
+					packageContents.getDefaultNameFileName()));
 	}