Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33359)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33360)
@@ -462,15 +462,24 @@
   // load the list of hosts
   SkyTable *sky = GetSkyTable();
-  if (!sky) return FALSE;
+  if (!sky) {
+    gprint (GP_ERR, "failed to load sky table for database\n");
+    return FALSE;
+  }
 
   char *tmppath = GetCATDIR ();
-  if (!tmppath) return FALSE;
+  if (!tmppath) {
+    gprint (GP_ERR, "failed to get CATDIR for database\n");
+    return FALSE;
+  }
 
   char *CATDIR = abspath (tmppath, MAX_PATH_LENGTH);
-  if (!CATDIR) return FALSE;
+  if (!CATDIR) {
+    gprint (GP_ERR, "failed to make an absolute path from %s (too long)\n", tmppath);
+    return FALSE;
+  }
 
   HostTable *table = HostTableLoad (CATDIR, sky->hosts);
   if (!table) {
-    fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
+    gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
     return FALSE;
   }    
@@ -485,8 +494,14 @@
   // determine time reference and format
   char *TimeRef = get_variable ("TIMEREF");
-  if (!TimeRef) return FALSE;
+  if (!TimeRef) {
+    gprint (GP_ERR, "failed to find TIMEREF variable\n");
+    return FALSE;
+  }
 
   char *TimeFormat = get_variable ("TIMEFORMAT");
-  if (!TimeFormat) return FALSE;
+  if (!TimeFormat) {
+    gprint (GP_ERR, "failed to find TIMEFORMAT variable\n");
+    return FALSE;
+  }
 
   char tmp;
@@ -502,5 +517,5 @@
 
   if (PARALLEL_MANUAL) {
-    fprintf (stderr, "run the relphot_client commands above.  when these are done, hit return\n");
+    gprint (GP_ERR, "run the relphot_client commands above.  when these are done, hit return\n");
     getchar();
   }
@@ -528,5 +543,8 @@
   if (ResultFile) {
     int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nvec, FALSE, NULL);
-    if (!status) return FALSE;
+    if (!status) {
+      gprint (GP_ERR, "failed to write result file %s\n", ResultFile);
+      return FALSE;
+    }
   }
 
