Index: /trunk/pswarp/src/pswarp.c
===================================================================
--- /trunk/pswarp/src/pswarp.c	(revision 27097)
+++ /trunk/pswarp/src/pswarp.c	(revision 27098)
@@ -20,5 +20,5 @@
     fprintf(stderr, "    [-variance variance.fits] : provide a corresponding variance image\n");
     psErrorStackPrint(stderr, "\n");
-    exit (2);
+    exit(PS_EXIT_CONFIG_ERROR);
 }
 
@@ -38,28 +38,24 @@
     // load identify the data sources
     if (!pswarpParseCamera(config)) {
-        psErrorStackPrint(stderr, "error setting up the camera\n");
-        exit(PS_EXIT_CONFIG_ERROR);
+        goto DIE;
     }
 
     if (!pswarpOptions(config)) {
-        psErrorStackPrint(stderr, "error parsing options\n");
-        exit(PS_EXIT_SYS_ERROR);
+        goto DIE;
     }
 
     // load the skycell layout information
     if (!pswarpDefine(config)) {
-        psErrorStackPrint(stderr, "error loading output definition\n");
-        exit(PS_EXIT_CONFIG_ERROR);
+        goto DIE;
     }
 
     // load and warp
     if (!pswarpLoop(config)) {
-        psErrorStackPrint(stderr, "error warping data\n");
-        exit(PS_EXIT_DATA_ERROR);
+        goto DIE;
     }
 
     psLogMsg("pswarp", PS_LOG_INFO, "complete pswarp run: %f sec\n", psTimerMark("pswarp"));
 
-    psExit exitValue = pswarpCleanup(config);
-    exit(exitValue);
+DIE:
+    return pswarpCleanup(config);
 }
