Index: trunk/pstamp/scripts/pstamp_finish.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_finish.pl	(revision 20166)
+++ trunk/pstamp/scripts/pstamp_finish.pl	(revision 20219)
@@ -74,12 +74,15 @@
         print STDERR  "output fileset directory $out_dir does not exist\n";
 
-        # XXX TODO: if this fails fault the request so we pstamp_finish 
-
-        mkdir $out_dir or die "cannot create output directory $out_dir";
+        if (!mkdir $out_dir) {
+            print STDERR "cannot create output directory $out_dir";
+            stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR, $dbname);
+        }
+
 
     } elsif (! -d $out_dir ) {
         # XXX TODO: fault the request so we pstamp_finish doesn't keep trying to process the
         # request
-        die "output fileset directory $out_dir exists but is not a directory";
+        print STDERR "output fileset directory $out_dir exists but is not a directory";
+        stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR, $dbname);
     }
 
@@ -87,5 +90,4 @@
         print STDERR "request file $req_file is missing\n";
         stop_request($req_id, $PS_EXIT_CONFIG_ERROR, $dbname);
-        exit  $PS_EXIT_CONFIG_ERROR;
     }
 
@@ -98,5 +100,4 @@
         print STDERR "failed to read request_file $req_file" ;
         stop_request($req_id, $PS_EXIT_CONFIG_ERROR, $dbname);
-        exit  $PS_EXIT_CONFIG_ERROR;
     }
 
@@ -231,4 +232,5 @@
             print STDERR "Unable to perform $command error code: $error_code\n";
             $request_fault = $error_code >> 8;
+            # fall through to stop the request
         }
     }
@@ -258,4 +260,5 @@
         die("Unable to perform $command error code: $error_code");
     }
+    exit $fault;
 }
 
