Index: trunk/ppSub/src/ppSubSetMasks.c
===================================================================
--- trunk/ppSub/src/ppSubSetMasks.c	(revision 23740)
+++ trunk/ppSub/src/ppSubSetMasks.c	(revision 26982)
@@ -28,10 +28,10 @@
     psImageMaskType maskValue, markValue; // Mask values
     if (!pmConfigMaskSetBits(&maskValue, &markValue, config)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to determine mask value.");
+        psError(PPSUB_ERR_CONFIG, false, "Unable to determine mask value.");
         return false;
     }
 
     // Set the mask bits needed by psphot (in psphot recipe)
-    psphotSetMaskRecipe (config, maskValue, markValue);
+    psphotSetMaskRecipe(config, maskValue, markValue);
 
     // Look up recipe values
@@ -79,9 +79,9 @@
     // Mask the NAN values
     if (!pmReadoutMaskNonfinite(inRO, satValue)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in input.");
+        psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in input.");
         return false;
     }
     if (!pmReadoutMaskNonfinite(refRO, satValue)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in reference.");
+        psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in reference.");
         return false;
     }
@@ -94,5 +94,5 @@
     psImageInterpolateMode interpMode = psImageInterpolateModeFromString(interpModeStr); // Interp
     if (interpMode == PS_INTERPOLATE_NONE) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unknown interpolation mode: %s", interpModeStr);
+        psError(PPSUB_ERR_CONFIG, false, "Unknown interpolation mode: %s", interpModeStr);
         return false;
     }
@@ -104,9 +104,9 @@
     // Interpolate over bad pixels, so the bad pixels don't explode
     if (!pmReadoutInterpolateBadPixels(inRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate bad pixels for input image.");
+        psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for input image.");
         return false;
     }
     if (!pmReadoutInterpolateBadPixels(refRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate bad pixels for reference image.");
+        psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for reference image.");
         return false;
     }
