Index: /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps.c
===================================================================
--- /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 37307)
+++ /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps.c	(revision 37308)
@@ -95,4 +95,9 @@
     dvo_catalog_unlock (&catalog);
     dvo_catalog_free (&catalog);
+
+    if (!status) {
+      fprintf (stderr, "failure to insert data in mysql\n");
+      exit (2);
+    }
   }
 
Index: /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c	(revision 37307)
+++ /branches/eam_branches/ipp-20140813/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c	(revision 37308)
@@ -210,5 +210,4 @@
   // XXX check return status
   if (mysql) {
-    if (DEBUG) fprintf (stderr, "%s\n", buffer->buffer);
     int mysqlStatus = mysql_query(mysql, buffer->buffer); 
     if (mysqlStatus) {
@@ -216,4 +215,5 @@
       fprintf (stderr, "%s\n", mysql_error(mysql));
       fprintf (stderr, "Nbuffer: %d\n", buffer->Nbuffer);
+      if (DEBUG) fprintf (stderr, "%s\n", buffer->buffer);
       status = FALSE;
     }
@@ -232,4 +232,10 @@
 
 int insert_detections_mysql_detvalue (IOBuffer *buffer, Detections *detection) {
+
+  if (detection->detectID == 164458937060000101) {
+    fprintf (stderr, "isfinite: %d\n", isfinite(detection->dMpsf));
+    fprintf (stderr, "isnan: %d\n", isnan(detection->dMpsf));
+    fprintf (stderr, "isinf: %d\n", isinf(detection->dMpsf));
+  }
 
   PrintIOBuffer (buffer, "(%lu, ", detection->objID);	    // objID
@@ -268,5 +274,5 @@
 
   if (isfinite(flux) && (flux > 0.0)) {
-    fprintf (stderr, "how did we get here?\n");
+    // fprintf (stderr, "funny flux: %f with mag %f\n", flux, mag);
     return (zp - 2.5*log10(flux));
   }
Index: /branches/eam_branches/ipp-20140813/Ohana/src/libohana/include/ohana.h
===================================================================
--- /branches/eam_branches/ipp-20140813/Ohana/src/libohana/include/ohana.h	(revision 37307)
+++ /branches/eam_branches/ipp-20140813/Ohana/src/libohana/include/ohana.h	(revision 37308)
@@ -192,5 +192,5 @@
 
 # ifndef isfinite
-# define isfinite(A) (!isnan(A))
+# define isfinite(A) (!isnan(A) && !isinf(A))
 # endif
 
