Index: /trunk/psModules/src/config/pmConfig.c
===================================================================
--- /trunk/psModules/src/config/pmConfig.c	(revision 10467)
+++ /trunk/psModules/src/config/pmConfig.c	(revision 10468)
@@ -4,6 +4,6 @@
  *  @author EAM (IfA)
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-12-05 02:31:24 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-12-05 03:42:11 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -476,5 +476,5 @@
     psMetadata *rule = psMetadataLookupMetadata(&mdStatus, cameraFormat, "RULE");
     if (! mdStatus || ! rule) {
-        psError(PS_ERR_UNKNOWN, true, "Unable to read rule for camera.\n");
+        psError(PS_ERR_UNKNOWN, false, "Unable to read rule for camera.");
         return false;
     }
@@ -487,7 +487,7 @@
         psMetadataItem *headerItem = psMetadataLookup(header, ruleItem->name);
         if (! headerItem) {
-            // It doesn't have a required header keyword, so it's not it
+            // doesn't match, but not an error
+            psTrace("psModules.config", 5, "Can't find %s", ruleItem->name);
             psFree(ruleIter);
-            psError(PS_ERR_UNKNOWN, true, "Can't find %s\n", ruleItem->name);
             return false;
         }
@@ -495,5 +495,5 @@
         // Check to see if the rule works
         if (! psMetadataItemCompare(headerItem, ruleItem)) {
-            psError(PS_ERR_UNKNOWN, true, "%s doesn't match.\n", ruleItem->name);
+            psTrace("psModules.config", 5, "%s doesn't match.", ruleItem->name);
             psFree(ruleIter);
             return false;
@@ -504,5 +504,4 @@
     return true;
 }
-
 
 // Given a camera and a header, see if any of the camera formats match the header
@@ -524,6 +523,5 @@
     psMetadata *formats = psMetadataLookupMetadata(&mdok, camera, "FORMATS"); // List of formats
     if (!mdok || !formats) {
-        psLogMsg("psModules.config", PS_LOG_WARN, "Unable to find list of FORMATS in camera %s --- ignored\n",
-                 cameraName);
+        psError(PS_ERR_UNKNOWN, false, "Unable to find list of FORMATS in camera %s", cameraName);
         return false;
     }
@@ -533,15 +531,13 @@
     while ((formatsItem = psMetadataGetAndIncrement(formatsIter))) {
         if (formatsItem->type != PS_DATA_STRING) {
-            psLogMsg("psModules.config", PS_LOG_WARN, "In camera %s, camera format %s is not of type STR --- "
-                     "ignored.\n", cameraName, formatsItem->name);
-            continue;
+            psError(PS_ERR_UNKNOWN, false, "In camera %s, camera format %s is not of type STR", cameraName, formatsItem->name);
+            return false;
         }
         psTrace("psModules.config", 5, "Reading camera format for %s...\n", formatsItem->name);
         psMetadata *testFormat = NULL;  // Format to test against what we've got
         if (!pmConfigFileRead(&testFormat, formatsItem->data.V, formatsItem->name)) {
-            psLogMsg("psModules.config", PS_LOG_WARN, "Trouble reading reading camera format %s --- ignored.\n",
-                     formatsItem->name);
+            psError(PS_ERR_UNKNOWN, false, "Trouble reading reading camera format %s", formatsItem->name);
             psFree(testFormat);
-            continue;
+            return false;
         }
 
@@ -557,6 +553,8 @@
             }
         } else {
-            if (psTraceGetLevel ("psModules.config") >= PS_LOG_INFO) {
-                psErrorStackPrint (stderr, "Camera %s, format %s does not match\n", cameraName, formatsItem->name);
+            psErr *error = psErrorLast();
+            if (error->code != PS_ERR_NONE) {
+                psError (PS_ERR_UNKNOWN, false, "Error in config scripts for camera %s, format %s\n", cameraName, formatsItem->name);
+                return false;
             }
         }
@@ -611,4 +609,10 @@
                 config->camera = psMemIncrRefCounter(testCamera);
                 config->cameraName = psStringCopy(camerasItem->name);
+            } else {
+                psErr *error = psErrorLast();
+                if (error->code != PS_ERR_NONE) {
+                    psError(PS_ERR_IO, false, "Error reading camera config data for %s", camerasItem->name);
+                    return NULL;
+                }
             }
             psFree(testCamera);
@@ -623,5 +627,4 @@
         // Now we have the camera, we can read the recipes
         pmConfigReadRecipes(config, PM_RECIPE_SOURCE_CAMERA | PM_RECIPE_SOURCE_CL);
-
         return format;
     }
