i changed the exception-handling of the new producers and localizers to use the multe...
authoridfx <idfx>
Thu, 9 May 2002 13:43:31 +0000 (13:43 +0000)
committeridfx <idfx>
Thu, 9 May 2002 13:43:31 +0000 (13:43 +0000)
31 files changed:
source/mir/config/ConfigChecker.java
source/mir/config/ConfigNode.java
source/mir/config/ConfigReader.java
source/mir/config/MirConfiguration.java
source/mir/config/exceptions/ConfigDefineNotKnownException.java
source/mir/config/exceptions/ConfigException.java [deleted file]
source/mir/config/exceptions/ConfigFailure.java [new file with mode: 0755]
source/mir/config/exceptions/ConfigInvalidPropertyTypeException.java
source/mir/config/exceptions/ConfigMissingPropertyException.java
source/mir/producer/Producer.java
source/mir/producer/ProducerException.java [deleted file]
source/mir/producer/ProducerFactory.java
source/mir/producer/ProducerFailure.java [new file with mode: 0755]
source/mircoders/global/ProducerEngine.java
source/mircoders/localizer/MirLocalizerException.java
source/mircoders/localizer/MirLocalizerFailure.java [new file with mode: 0755]
source/mircoders/localizer/MirProducerToolLocalizer.java
source/mircoders/localizer/basic/MirBasicProducerToolLocalizer.java
source/mircoders/producer/CompositeProducer.java
source/mircoders/producer/CompositeProducerFactory.java
source/mircoders/producer/ContentProducer.java
source/mircoders/producer/ContentProducerFactory.java
source/mircoders/producer/NullProducer.java
source/mircoders/producer/OldProducerAdapter.java
source/mircoders/producer/ScriptCallProducer.java
source/mircoders/producer/ScriptCallProducerFactory.java
source/mircoders/producer/StartPageProducer.java
source/mircoders/producer/StartPageProducerFactory.java
source/mircoders/producer/StaticProducer.java
source/mircoders/producer/StaticProducerFactory.java
source/mircoders/producer/TopicStartPageProducerFactory.java

index 70006bf..bc5528d 100755 (executable)
@@ -25,7 +25,7 @@ public class ConfigChecker {
     rootNode = new Node();\r
   }\r
 \r
-  public void check(ConfigNode aNode) throws ConfigException {\r
+  public void check(ConfigNode aNode) throws ConfigFailure {\r
     getRootNode().check(aNode);\r
   }\r
 \r
@@ -63,7 +63,7 @@ public class ConfigChecker {
       addTypeConstraint(aPropertyName, aType);\r
     }\r
 \r
-    public void check(ConfigNode aNode) throws ConfigException {\r
+    public void check(ConfigNode aNode) throws ConfigFailure {\r
       Iterator iterator;\r
 \r
       iterator=constraints.iterator();\r
@@ -86,7 +86,7 @@ public class ConfigChecker {
         propertyName=aPropertyName;\r
       }\r
 \r
-      public void check(ConfigNode aNode) throws ConfigException {\r
+      public void check(ConfigNode aNode) throws ConfigFailure {\r
       };\r
     }\r
 \r
@@ -95,7 +95,7 @@ public class ConfigChecker {
         super(aPropertyName);\r
       }\r
 \r
-      public void check(ConfigNode aNode) throws ConfigException {\r
+      public void check(ConfigNode aNode) throws ConfigFailure {\r
         aNode.getRequiredStringProperty(propertyName);\r
       };\r
     }\r
@@ -109,7 +109,7 @@ public class ConfigChecker {
         type=aType;\r
       }\r
 \r
-      public void check(ConfigNode aNode) throws ConfigException {\r
+      public void check(ConfigNode aNode) throws ConfigFailure {\r
         switch(type) {\r
           case INTEGER:\r
             aNode.getOptionalIntegerProperty(propertyName, new Integer(0));\r
@@ -124,7 +124,7 @@ public class ConfigChecker {
             aNode.getOptionalBooleanProperty(propertyName, Boolean.FALSE);\r
             break;\r
           default:\r
-            throw new ConfigException("Invalid value for type in type constraint: "+new Integer(type).toString());\r
+            throw new ConfigFailure("Invalid value for type in type constraint: "+new Integer(type).toString());\r
         }\r
       }\r
     }\r
index 868bccb..a70aae0 100755 (executable)
@@ -8,12 +8,12 @@ public interface ConfigNode {
   public String getLocationDescription();\r
 \r
   public ConfigNode getSubNode(String aSubNodeName);\r
-  public Boolean getRequiredBooleanProperty(String aPropertyName) throws ConfigException;\r
-  public Integer getRequiredIntegerProperty(String aPropertyName) throws ConfigException;\r
-  public String getRequiredStringProperty(String aPropertyName) throws ConfigException;\r
-  public Double getRequiredDoubleProperty(String aPropertyName) throws ConfigException;\r
-  public Boolean getOptionalBooleanProperty(String aPropertyName, Boolean aDefaultValue) throws ConfigException;\r
-  public Integer getOptionalIntegerProperty(String aPropertyName, Integer aDefaultValue) throws ConfigException;\r
-  public String getOptionalStringProperty(String aPropertyName, String aDefaultValue) throws ConfigException;\r
-  public Double getOptionalDoubleProperty(String aPropertyName, Double aDefaultValue) throws ConfigException;\r
+  public Boolean getRequiredBooleanProperty(String aPropertyName) throws ConfigFailure;\r
+  public Integer getRequiredIntegerProperty(String aPropertyName) throws ConfigFailure;\r
+  public String getRequiredStringProperty(String aPropertyName) throws ConfigFailure;\r
+  public Double getRequiredDoubleProperty(String aPropertyName) throws ConfigFailure;\r
+  public Boolean getOptionalBooleanProperty(String aPropertyName, Boolean aDefaultValue) throws ConfigFailure;\r
+  public Integer getOptionalIntegerProperty(String aPropertyName, Integer aDefaultValue) throws ConfigFailure;\r
+  public String getOptionalStringProperty(String aPropertyName, String aDefaultValue) throws ConfigFailure;\r
+  public Double getOptionalDoubleProperty(String aPropertyName, Double aDefaultValue) throws ConfigFailure;\r
 }\r
index 03ecd53..d0c0355 100755 (executable)
@@ -26,7 +26,7 @@ public class ConfigReader {
     super();\r
   };\r
 \r
-  public void parseFile(String aFileName, ConfigNodeBuilder aRootNode) throws ConfigException {\r
+  public void parseFile(String aFileName, ConfigNodeBuilder aRootNode) throws ConfigFailure {\r
 \r
     try {\r
       SAXParserFactory parserFactory = SAXParserFactory.newInstance();\r
@@ -40,12 +40,12 @@ public class ConfigReader {
       handler.includeFile(aFileName);\r
     }\r
     catch (Throwable e) {\r
-      if (e instanceof SAXParseException && ((SAXParseException) e).getException() instanceof ConfigException) {\r
-        throw (ConfigException) ((SAXParseException) e).getException();\r
+      if (e instanceof SAXParseException && ((SAXParseException) e).getException() instanceof ConfigFailure) {\r
+        throw (ConfigFailure) ((SAXParseException) e).getException();\r
       }\r
       else {\r
         e.printStackTrace();\r
-        throw new ConfigException( e.getMessage() );\r
+        throw new ConfigFailure( e.getMessage() );\r
       }\r
     }\r
   }\r
@@ -78,7 +78,7 @@ public class ConfigReader {
       locator=aLocator;\r
     }\r
 \r
-    private void includeFile(String aFileName) throws ConfigException, SAXParseException, SAXException {\r
+    private void includeFile(String aFileName) throws ConfigFailure, SAXParseException, SAXException {\r
       File file;\r
       SAXParser parser;\r
       InputSource inputSource;\r
@@ -93,7 +93,7 @@ public class ConfigReader {
         System.err.println("about to include "+file.getCanonicalPath());\r
 \r
         if (includeFileStack.contains(file.getCanonicalPath())) {\r
-          throw new ConfigException("recursive inclusion of file "+file.getCanonicalPath(), getLocatorDescription(locator));\r
+          throw new ConfigFailure("recursive inclusion of file "+file.getCanonicalPath(), getLocatorDescription(locator));\r
         }\r
 \r
         parser=parserFactory.newSAXParser();\r
@@ -110,19 +110,19 @@ public class ConfigReader {
         }\r
       }\r
       catch (ParserConfigurationException e) {\r
-        throw new ConfigException("Internal exception while including \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));\r
+        throw new ConfigFailure("Internal exception while including \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));\r
       }\r
       catch (SAXParseException e) {\r
         throw e;\r
       }\r
-      catch (ConfigException e) {\r
+      catch (ConfigFailure e) {\r
         throw e;\r
       }\r
       catch (FileNotFoundException e) {\r
-        throw new ConfigException("Include file \""+aFileName+"\" not found: "+e.getMessage(), e, getLocatorDescription(locator));\r
+        throw new ConfigFailure("Include file \""+aFileName+"\" not found: "+e.getMessage(), e, getLocatorDescription(locator));\r
       }\r
       catch (IOException e) {\r
-        throw new ConfigException("unable to open include file \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));\r
+        throw new ConfigFailure("unable to open include file \""+aFileName+"\": "+e.getMessage(), e, getLocatorDescription(locator));\r
       }\r
 \r
     }\r
@@ -132,18 +132,18 @@ public class ConfigReader {
       level++;\r
       try {\r
         if (builder==null) {\r
-          throw new ConfigException("define, include and property tags cannot have content", getLocatorDescription(locator));\r
+          throw new ConfigFailure("define, include and property tags cannot have content", getLocatorDescription(locator));\r
         }\r
         if (aQualifiedName.equals(propertyTagName)) {\r
           String name=anAttributes.getValue(propertyNameAttribute);\r
           String value=anAttributes.getValue(propertyValueAttribute);\r
 \r
           if (name==null) {\r
-            throw new ConfigException("property has no name attribute", getLocatorDescription(locator));\r
+            throw new ConfigFailure("property has no name attribute", getLocatorDescription(locator));\r
           }\r
           else\r
           if (value==null) {\r
-            throw new ConfigException("property \""+name+"\" has no value attribute", getLocatorDescription(locator));\r
+            throw new ConfigFailure("property \""+name+"\" has no value attribute", getLocatorDescription(locator));\r
           }\r
 \r
           builder.addProperty(name, definesManager.resolve(value, getLocatorDescription(locator)), value, getLocatorDescription(locator));\r
@@ -155,11 +155,11 @@ public class ConfigReader {
           String value=anAttributes.getValue(defineValueAttribute);\r
 \r
           if (name==null) {\r
-            throw new ConfigException("define has no name attribute", getLocatorDescription(locator));\r
+            throw new ConfigFailure("define has no name attribute", getLocatorDescription(locator));\r
           }\r
           else\r
           if (value==null) {\r
-            throw new ConfigException("define \""+name+"\" has no value attribute", getLocatorDescription(locator));\r
+            throw new ConfigFailure("define \""+name+"\" has no value attribute", getLocatorDescription(locator));\r
           }\r
 \r
           definesManager.addDefine(name, definesManager.resolve(value, getLocatorDescription(locator)));\r
@@ -169,7 +169,7 @@ public class ConfigReader {
           String fileName=anAttributes.getValue(includeFileAttribute);\r
 \r
           if (fileName==null) {\r
-            throw new ConfigException("include has no file attribute", getLocatorDescription(locator));\r
+            throw new ConfigFailure("include has no file attribute", getLocatorDescription(locator));\r
           }\r
 \r
           includeFile(definesManager.resolve(fileName, getLocatorDescription(locator)));\r
@@ -180,7 +180,7 @@ public class ConfigReader {
           builder=builder.makeSubNode(aQualifiedName, getLocatorDescription(locator));\r
         }\r
       }\r
-      catch (ConfigException e) {\r
+      catch (ConfigFailure e) {\r
         throw new SAXParseException(e.getMessage(), locator, e);\r
       }\r
     }\r
@@ -193,7 +193,7 @@ public class ConfigReader {
     public void characters(char[] aBuffer, int aStart, int anEnd) throws SAXParseException {\r
       String text = new String(aBuffer, aStart, anEnd).trim();\r
       if ( text.length() > 0) {\r
-        throw new SAXParseException("Text not allowed", locator, new ConfigException("text not allowed", getLocatorDescription(locator)));\r
+        throw new SAXParseException("Text not allowed", locator, new ConfigFailure("text not allowed", getLocatorDescription(locator)));\r
       }\r
     }\r
   }\r
@@ -209,7 +209,7 @@ public class ConfigReader {
       defines.put(aName, anExpression);\r
     }\r
 \r
-    public String resolve(String anExpression, String aLocation) throws ConfigException {\r
+    public String resolve(String anExpression, String aLocation) throws ConfigFailure {\r
       int previousPosition = 0;\r
       int position;\r
       int endOfNamePosition;\r
@@ -239,7 +239,7 @@ public class ConfigReader {
               }\r
             }\r
             else {\r
-                throw new ConfigException("Missing }", aLocation);\r
+                throw new ConfigFailure("Missing }", aLocation);\r
             }\r
 \r
           }\r
index 9885f02..53fa7f1 100755 (executable)
@@ -15,7 +15,7 @@ public class MirConfiguration {
     rootNode = aRootNode;\r
   }\r
 \r
-  public MirConfiguration(String aFileName) throws ConfigException {\r
+  public MirConfiguration(String aFileName) throws ConfigFailure {\r
     super();\r
     rootNode = new ConfigSimpleNode();\r
 \r
index 21fce9c..cc94380 100755 (executable)
@@ -1,6 +1,6 @@
 package mir.config.exceptions;\r
 \r
-public class ConfigDefineNotKnownException extends ConfigException {\r
+public class ConfigDefineNotKnownException extends ConfigFailure {\r
   public ConfigDefineNotKnownException(String aMessage, String aLocation) {\r
     super (aMessage, aLocation);\r
   }\r
diff --git a/source/mir/config/exceptions/ConfigException.java b/source/mir/config/exceptions/ConfigException.java
deleted file mode 100755 (executable)
index f02c79f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package mir.config.exceptions;\r
-\r
-import java.io.*;\r
-\r
-public class ConfigException extends Exception {\r
-  private String locationDescription;\r
-  private Throwable cause;\r
-\r
-  public ConfigException (String aMessage, Throwable aCause, String aLocationDescription) {\r
-    super ("Configuration error at "+aLocationDescription+": "+aMessage);\r
-\r
-    locationDescription = aLocationDescription;\r
-    cause = aCause;\r
-  }\r
-\r
-  public ConfigException (String aMessage, String aLocationDescription) {\r
-    this (aMessage, (Throwable) null, aLocationDescription);\r
-  }\r
-\r
-  public ConfigException (String aMessage) {\r
-    this (aMessage, (Throwable) null, "?");\r
-  }\r
-}\r
diff --git a/source/mir/config/exceptions/ConfigFailure.java b/source/mir/config/exceptions/ConfigFailure.java
new file mode 100755 (executable)
index 0000000..786fb93
--- /dev/null
@@ -0,0 +1,25 @@
+package mir.config.exceptions;\r
+\r
+import multex.Failure;
+
+import java.io.*;\r
+\r
+public class ConfigFailure extends Failure {\r
+  private String locationDescription;\r
+  private Throwable cause;\r
+\r
+  public ConfigFailure (String aMessage, Throwable aCause, String aLocationDescription) {\r
+    super ("Configuration error at "+aLocationDescription+": "+aMessage,aCause);\r
+\r
+    locationDescription = aLocationDescription;\r
+    cause = aCause;\r
+  }\r
+\r
+  public ConfigFailure (String aMessage, String aLocationDescription) {\r
+    this (aMessage, (Throwable) null, aLocationDescription);\r
+  }\r
+\r
+  public ConfigFailure (String aMessage) {\r
+    this (aMessage, (Throwable) null, "?");\r
+  }\r
+}\r
index 494227f..b0c6869 100755 (executable)
@@ -1,6 +1,6 @@
 package mir.config.exceptions;\r
 \r
-public class ConfigInvalidPropertyTypeException extends ConfigException {\r
+public class ConfigInvalidPropertyTypeException extends ConfigFailure {\r
   public ConfigInvalidPropertyTypeException(String aMessage, String aLocation) {\r
     super (aMessage, aLocation);\r
   }\r
index df19705..f80e233 100755 (executable)
@@ -1,6 +1,6 @@
 package mir.config.exceptions;\r
 \r
-public class ConfigMissingPropertyException extends ConfigException {\r
+public class ConfigMissingPropertyException extends ConfigFailure {\r
   public ConfigMissingPropertyException(String aMessage, String aLocation) {\r
     super (aMessage, aLocation);\r
   }\r
index be9415a..ff57f36 100755 (executable)
@@ -3,5 +3,5 @@ package mir.producer;
 import java.io.*;
 
 public interface Producer {
-  public void produce( PrintWriter aLogger ) throws ProducerException;
+  public void produce( PrintWriter aLogger ) throws ProducerFailure;
 }
diff --git a/source/mir/producer/ProducerException.java b/source/mir/producer/ProducerException.java
deleted file mode 100755 (executable)
index 7c0cf11..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package mir.producer;
-
-public class ProducerException extends Exception {
-
-  public ProducerException(Throwable cause) {
-    super(cause.getMessage());
-  }
-}
\ No newline at end of file
index 401c25e..6cb01be 100755 (executable)
@@ -3,7 +3,7 @@ package mir.producer;
 import java.util.*;
 
 public interface ProducerFactory {
-  public Producer makeProducer(String aVerb) throws ProducerException;
+  public Producer makeProducer(String aVerb) throws ProducerFailure;
   public Iterator verbs();
 }
 
diff --git a/source/mir/producer/ProducerFailure.java b/source/mir/producer/ProducerFailure.java
new file mode 100755 (executable)
index 0000000..580e1d0
--- /dev/null
@@ -0,0 +1,10 @@
+package mir.producer;
+
+import multex.Failure;
+
+public class ProducerFailure extends Failure {
+
+  public ProducerFailure(String msg,Throwable cause) {
+    super(msg,cause);
+  }
+}
\ No newline at end of file
index 33ebb65..b59a523 100755 (executable)
@@ -4,6 +4,8 @@ import java.util.*;
 import java.io.*;
 import mir.producer.*;
 import mir.util.*;
+import multex.Exc;
+import multex.Failure;
 
 public class ProducerEngine {
   private Map producers;
@@ -18,9 +20,8 @@ public class ProducerEngine {
       log = new PrintWriter(new FileWriter(new File("/tmp/producer.log")));
     }
     catch (Exception e) {
-      throw new RuntimeException(e.getMessage());
+      throw new ProducerEngineRuntimeExc("Creating PrintWriter log failed",e);
     }
-
     queueThread = new Thread(new ProducerJobQueueThread());
     queueThread.start();
   }
@@ -136,4 +137,11 @@ public class ProducerEngine {
     }
   }
 
+
+  public static class ProducerEngineRuntimeExc extends Failure {
+    public ProducerEngineRuntimeExc(String msg, Exception cause){
+      super(msg,cause);
+    }
+  }
+
 }
\ No newline at end of file
index 9bb04db..1bb8215 100755 (executable)
@@ -1,11 +1,10 @@
 package mircoders.localizer;
 
-public class MirLocalizerException extends Exception {
+import multex.Exc;
+
+public class MirLocalizerException extends Exc {
 
   public MirLocalizerException(String aMessage) {
     super(aMessage);
   }
-  public MirLocalizerException(Throwable aCause) {
-    super(aCause.getMessage());
-  }
 }
\ No newline at end of file
diff --git a/source/mircoders/localizer/MirLocalizerFailure.java b/source/mircoders/localizer/MirLocalizerFailure.java
new file mode 100755 (executable)
index 0000000..71a73ef
--- /dev/null
@@ -0,0 +1,9 @@
+package mircoders.localizer;
+
+import multex.Failure;
+
+public class MirLocalizerFailure extends Failure {
+  public MirLocalizerFailure(String msg, Throwable throwable) {
+    super(msg, throwable);
+  }
+}
index 5a1c44a..a9bf823 100755 (executable)
@@ -5,6 +5,6 @@ import java.io.*;
 
 public interface MirProducerToolLocalizer {
   public void initializeGenerationValueSet(Map aValueSet);
-  public PrintWriter openWriter(String anIdentifier) throws MirLocalizerException;
+  public PrintWriter openWriter(String anIdentifier) throws MirLocalizerFailure;
   public void closeWriter(PrintWriter aWriter);
 }
index 8a5eb8c..406f031 100755 (executable)
@@ -56,7 +56,7 @@ public class MirBasicProducerToolLocalizer implements MirProducerToolLocalizer {
     aValueSet.put("parentlist", parentList);
   };
 
-  public PrintWriter openWriter(String anIdentifier) throws MirLocalizerException {
+  public PrintWriter openWriter(String anIdentifier) throws MirLocalizerFailure {
     File file;
     File dir;
 
@@ -74,7 +74,7 @@ public class MirBasicProducerToolLocalizer implements MirProducerToolLocalizer {
       );
     }
     catch (Throwable t) {
-      throw new MirLocalizerException(t);
+      throw new MirLocalizerFailure("Failure while opening a PrintWriter",t);
     }
   };
 
index d444d16..9ce0c0d 100755 (executable)
@@ -16,7 +16,7 @@ public class CompositeProducer implements mir.producer.Producer {
     producers.add(aProducer);
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     Iterator i;
 
     i=producers.iterator();
index 2ef4a27..5b1de14 100755 (executable)
@@ -36,7 +36,7 @@ public class CompositeProducerFactory implements ProducerFactory {
     }
   }
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
     CompositeProducer result = new CompositeProducer();
 
     Iterator i=factoriesForVerb(aVerb).iterator();
index 424fa71..09fbfa6 100755 (executable)
@@ -39,7 +39,7 @@ public class ContentProducer implements mir.producer.Producer {
     outputFileExpression = anOutputFileExpression;
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     EntityContent content;
 
     Map generationValues = new HashMap();
index 94b437f..a455488 100755 (executable)
@@ -23,7 +23,7 @@ public class ContentProducerFactory implements ProducerFactory {
     batchSize=aBatchSize;
   }
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
     try {
       QueryBuilder queryBuilder = new QueryBuilder();
 
@@ -44,7 +44,7 @@ public class ContentProducerFactory implements ProducerFactory {
         outputFileNameExpression
       );
     } catch (Exception e) {
-      throw new ProducerException(e);
+      throw new ProducerFailure("Creating Producer failed",e);
     }
   };
 
index 7ebb768..3ddf158 100755 (executable)
@@ -7,7 +7,7 @@ public class NullProducer implements mir.producer.Producer {
   public NullProducer() {
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
   }
 }
 
index d3a4742..65656fc 100755 (executable)
@@ -13,12 +13,12 @@ public class OldProducerAdapter implements mir.producer.Producer {
     forced = aForced;
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     try {
       oldProducer.handle( aLogger, null, forced.booleanValue(), false );
     }
     catch (Throwable e) {
-      throw new ProducerException(e);
+      throw new ProducerFailure("Failure at handling old Producers",e);
     }
   }
 }
\ No newline at end of file
index e17087a..8497f43 100755 (executable)
@@ -12,7 +12,7 @@ public class ScriptCallProducer implements mir.producer.Producer {
     script = aScript;
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     Process process;
     int returnValue;
 
@@ -26,7 +26,7 @@ public class ScriptCallProducer implements mir.producer.Producer {
     catch (Throwable e) {
       aLogger.println("Exception has occurred: " + e.getMessage() + ":");
       e.printStackTrace(aLogger);
-      throw new ProducerException(e);
+      throw new ProducerFailure("Executing script failed",e);
     }
   }
 }
index b8ae757..9f96b7a 100755 (executable)
@@ -13,7 +13,7 @@ public class ScriptCallProducerFactory implements ProducerFactory {
     script=aScript;
   }
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
 
 
     return new ScriptCallProducer(script);
index 0602c5c..3af126f 100755 (executable)
@@ -47,7 +47,7 @@ public class StartPageProducer implements mir.producer.Producer {
     breakingNews = aBreakingNews;
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     Map generationValues = new HashMap();
     Map dataMap = new HashMap();
 
index d474338..6bea900 100755 (executable)
@@ -28,7 +28,7 @@ public class StartPageProducerFactory implements ProducerFactory {
   }
 
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
 
     try {
       ModuleContent contentModule = new ModuleContent(DatabaseContent.getInstance());
@@ -45,7 +45,7 @@ public class StartPageProducerFactory implements ProducerFactory {
                     breakingModule.getBreakingNews());
     }
     catch (Throwable e) {
-      throw new ProducerException(e);
+      throw new ProducerFailure("Creating StartPageProducer failed",e);
     }
   };
 
index 67ea4f7..afdb836 100755 (executable)
@@ -32,7 +32,7 @@ public class StaticProducer implements mir.producer.Producer {
     outputFile=anOutputFile;
   }
 
-  public void produce( PrintWriter aLogger ) throws ProducerException {
+  public void produce( PrintWriter aLogger ) throws ProducerFailure {
     Map generationValues = new HashMap();
     Map dataMap = new HashMap();
 
index df703e1..f5024cd 100755 (executable)
@@ -19,12 +19,12 @@ public class StaticProducerFactory implements ProducerFactory {
   }
 
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
     try {
       return new StaticProducer( generatorIdentifier, resourceBundle, outputFile );
     }
     catch (Throwable e) {
-      throw new ProducerException(e);
+      throw new ProducerFailure("Creating StaticProducer failed",e);
     }
   };
 
index af9e4eb..aee7267 100755 (executable)
@@ -31,7 +31,7 @@ public class TopicStartPageProducerFactory implements ProducerFactory {
   }
 
 
-  public mir.producer.Producer makeProducer(String aVerb) throws ProducerException {
+  public mir.producer.Producer makeProducer(String aVerb) throws ProducerFailure {
     CompositeProducer result = new CompositeProducer();
     Map values = new HashMap();
 
@@ -78,7 +78,7 @@ public class TopicStartPageProducerFactory implements ProducerFactory {
 
     }
     catch (Throwable e) {
-      throw new ProducerException(e);
+      throw new ProducerFailure("Creating TopicStartPageProducer failed",e);
     }
   };