Index: trunk/pswarp/src/pswarpSetMaskBits.c
===================================================================
--- trunk/pswarp/src/pswarpSetMaskBits.c	(revision 26013)
+++ trunk/pswarp/src/pswarpSetMaskBits.c	(revision 27096)
@@ -28,5 +28,5 @@
     // this function sets the required single-image mask bits
     if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) {
-        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
+        psError (psErrorCodeLast(), false, "Unable to define the mask bit values");
         return false;
     }
@@ -64,5 +64,5 @@
     }
     if (!markOut) {
-        psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");
+        psError(PSWARP_ERR_CONFIG, true, "Unable to define the MARK bit mask: all bits taken!");
         return false;
     }
@@ -71,5 +71,5 @@
     psMetadata *warpRecipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
     if (!warpRecipe) {
-        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
+        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
         return false;
     }
@@ -85,5 +85,5 @@
     psMetadata *psphotRecipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
     if (!psphotRecipe) {
-        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE);
+        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE);
         return false;
     }
