Index: /trunk/ippTools/src/p2insertDoneFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertDoneFrames.c	(revision 6130)
+++ /trunk/ippTools/src/p2insertDoneFrames.c	(revision 6131)
@@ -3,5 +3,5 @@
 
 // select pending frames (exposure+images) which are done/not done
-bool p2insertDoneFrames (p2Config *config, psArray *doneFrames) {
+bool p2insertDoneFrames(p2Config *config, psArray *doneFrames) {
 
     for (int i = 0; i < doneFrames->n; i++) {
@@ -11,8 +11,14 @@
         psArray *doneImages = doneFrame->images;
         
-        p2DoneExpInsertObject(config->database, doneExposure);
+        if (!p2DoneExpInsertObject(config->database, doneExposure)) {
+            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            return false;
+        }
 
         for (int i = 0; i < doneImages->n; i++) {
-            p2DoneImfileInsertObject(config->database, doneImages->data[i]);
+            if (!p2DoneImfileInsertObject(config->database, doneImages->data[i])) {
+            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            return false;
+            }
         }
     }
Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6130)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6131)
@@ -6,5 +6,5 @@
 // NOTE this function converts the rawFrames to pendingFrames AND inserts them
 //      this is useful since the table must be locked the whole time, to get the versions
-bool p2insertPendingFrames (p2Config *config, psArray *rawFrames) {
+bool p2insertPendingFrames(p2Config *config, psArray *rawFrames) {
 
     psMetadata *where = psMetadataAlloc();
@@ -58,9 +58,15 @@
         }
         
-        p2PendingExpInsertObject(config->database, pendingExposure);
+        if (!p2PendingExpInsertObject(config->database, pendingExposure)) {
+            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            return false;
+        }
 
         for (int i = 0; i < pendingImages->n; i++) {
-                p2PendingImfileInsertObject(config->database,
-                    pendingImages->data[i]);
+            if (!p2PendingImfileInsertObject(config->database,
+                    pendingImages->data[i])) {
+                psError(PS_ERR_UNKNOWN, false, "database access failed");
+                return false;
+            }
         }
     }
