jruaux 2003/01/17 07:22:29
Modified: Eclipse-Plugin/src/java/org/apache/cactus/eclipse/containers/ant
GenericAntProvider.java
Log:
Improved error handling and reporting
Revision Changes Path
1.10 +23 -16
jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/containers/ant/GenericAntProvider.java
Index: GenericAntProvider.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/Eclipse-Plugin/src/java/org/apache/cactus/eclipse/containers/ant/GenericAntProvider.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- GenericAntProvider.java 16 Jan 2003 11:37:04 -0000 1.9
+++ GenericAntProvider.java 17 Jan 2003 15:22:28 -0000 1.10
@@ -70,9 +70,7 @@
import org.eclipse.ant.core.AntRunner;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
@@ -114,12 +112,29 @@
* @param thePort the port that will be used when setting up the container
* @param theTargetDir the directory to be used for container configuration
* @param theHomes ContainerHome array for container config
+ * @throws CoreException if an argument is invalid
*/
public GenericAntProvider(
int thePort,
String theTargetDir,
ContainerHome[] theHomes)
+ throws CoreException
{
+ if (thePort <= 0)
+ {
+ CactusPlugin.throwCoreException(
+ "CactusLaunch.message.invalidproperty.port", null);
+ }
+ if (theTargetDir.equalsIgnoreCase(""))
+ {
+ CactusPlugin.throwCoreException(
+ "CactusLaunch.message.invalidproperty.tempdir", null);
+ }
+ if (theHomes.length == 0)
+ {
+ CactusPlugin.throwCoreException(
+ "CactusLaunch.message.invalidproperty.containers", null);
+ }
port = thePort;
containerHomes = theHomes;
antArguments = new Vector();
@@ -166,13 +181,9 @@
}
catch (MalformedURLException e)
{
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- CactusPlugin.getPluginId(),
- IStatus.OK,
- e.getMessage(),
- e));
+ CactusPlugin.throwCoreException(
+ "CactusLaunch.message.start.error",
+ e);
}
startHelper.setTestURL(testURL);
startHelper.setProgressMonitor(new SubProgressMonitor(thePM, 4));
@@ -182,13 +193,9 @@
}
catch (BuildException e)
{
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- CactusPlugin.getPluginId(),
- IStatus.OK,
- e.getMessage(),
- e));
+ CactusPlugin.throwCoreException(
+ "CactusLaunch.message.start.error",
+ e);
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>