Index: branches/pap/ppStack/src/ppStackPhotometry.c
===================================================================
--- branches/pap/ppStack/src/ppStackPhotometry.c	(revision 23511)
+++ branches/pap/ppStack/src/ppStackPhotometry.c	(revision 23580)
@@ -69,8 +69,14 @@
 
     if (!psphotReadoutKnownSources(config, photView, inSources)) {
-        // Clear the error, so that the output files are written.
-        psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on stacked image.");
-        psFree(photView);
-        return false;
+        // This is likely a data quality issue
+        // XXX Split into multiple cases using error codes?
+        psErrorStackPrint("Unable to perform photometry on image");
+        psWarning("Unable to perform photometry on image --- suspect bad data quality.");
+        if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) {
+            psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
+                             "Unable to perform photometry on image", psErrorCodeLast());
+        }
+        psErrorClear();
+        psphotFilesActivate(config, false);
     }
 
