jruaux 2003/02/04 08:54:26
Modified: integration/eclipse/src/java/org/apache/cactus/eclipse/ui
CactusMessages.properties CactusPlugin.java
Log:
Better error handling (null pointer exception for non-existing resources)
Revision Changes Path
1.2 +3 -1
jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties
Index: CactusMessages.properties
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/ui/CactusMessages.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CactusMessages.properties 3 Feb 2003 10:52:39 -0000 1.1
+++ CactusMessages.properties 4 Feb 2003 16:54:26 -0000 1.2
@@ -7,6 +7,8 @@
CactusLaunch.dialog.title = Cactus launch
CactusLaunch.message.prepare = Preparing for Cactus tests
CactusLaunch.message.prepare.error = Preparation failed
+CactusLaunch.message.prepare.error.plugin.file = Missing plugin file
+CactusLaunch.message.prepare.error.project.file = Missing project file
CactusLaunch.message.teardown = Tearing down Cactus tests
CactusLaunch.message.teardown.error = Tearing down failed
CactusLaunch.message.error = Error when launching tests
1.2 +24 -8
jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java
Index: CactusPlugin.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/ui/CactusPlugin.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CactusPlugin.java 3 Feb 2003 10:52:39 -0000 1.1
+++ CactusPlugin.java 4 Feb 2003 16:54:26 -0000 1.2
@@ -266,24 +266,40 @@
theMessage);
}
/**
- * Helper method for other classes. Throws a CoreException with
- * the message corresponding to the given message key.
+ * Helper method for other classes. Returns a CoreException with a message
+ * corresponding to the given message key.
* @param theMessageKey the key of the message to be thrown
* @param theException a low-level exception, or null if not applicable
- * @throws CoreException always thrown
+ * @return the constructed CoreException
*/
- public static void throwCoreException(
+ public static CoreException createCoreException(
String theMessageKey,
Throwable theException)
- throws CoreException
+ {
+ return createCoreException(theMessageKey, "", theException);
+ }
+
+ /**
+ * Helper method for other classes. Returns a CoreException with a message
+ * corresponding to the given message key and the additional String.
+ * @param theMessageKey the key of the message to be thrown
+ * @param theString String to be concatenated with the message
+ * @param theException a low-level exception, or null if not applicable
+ * @return the constructed CoreException
+ */
+ public static CoreException createCoreException(
+ String theMessageKey,
+ String theString,
+ Throwable theException)
{
String message = CactusMessages.getString(theMessageKey);
- throw new CoreException(
+ message += theString;
+ return new CoreException(
new Status(
IStatus.ERROR,
CactusPlugin.getPluginId(),
IStatus.OK,
message,
theException));
- }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]