Index: branches/simmosaic_branches/pswarp/src/pswarpHeadersLoad.c
===================================================================
--- branches/simmosaic_branches/pswarp/src/pswarpHeadersLoad.c	(revision 24860)
+++ branches/simmosaic_branches/pswarp/src/pswarpHeadersLoad.c	(revision 27839)
@@ -74,5 +74,5 @@
     if (bilevelAstrometry) {
         if (!pmAstromReadBilevelMosaic(input->fpa, phu->header)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input.");
+            psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for input.");
             psFree(view);
             return false;
@@ -92,5 +92,5 @@
         if (bilevelAstrometry) {
             if (!pmAstromReadBilevelChip (chip, hdu->header)) {
-                psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel chip astrometry for input.");
+                psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for input.");
                 psFree(view);
                 return false;
@@ -99,5 +99,5 @@
             // we use a default FPA pixel scale of 1.0
             if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) {
-                psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry for input.");
+                psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for input.");
                 psFree(view);
                 return false;
