IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20219


Ignore:
Timestamp:
Oct 17, 2008, 9:39:31 AM (18 years ago)
Author:
bills
Message:

make sure request->state gets set to stop on failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_finish.pl

    r20114 r20219  
    7474        print STDERR  "output fileset directory $out_dir does not exist\n";
    7575
    76         # XXX TODO: if this fails fault the request so we pstamp_finish
    77 
    78         mkdir $out_dir or die "cannot create output directory $out_dir";
     76        if (!mkdir $out_dir) {
     77            print STDERR "cannot create output directory $out_dir";
     78            stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR, $dbname);
     79        }
     80
    7981
    8082    } elsif (! -d $out_dir ) {
    8183        # XXX TODO: fault the request so we pstamp_finish doesn't keep trying to process the
    8284        # request
    83         die "output fileset directory $out_dir exists but is not a directory";
     85        print STDERR "output fileset directory $out_dir exists but is not a directory";
     86        stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR, $dbname);
    8487    }
    8588
     
    8790        print STDERR "request file $req_file is missing\n";
    8891        stop_request($req_id, $PS_EXIT_CONFIG_ERROR, $dbname);
    89         exit  $PS_EXIT_CONFIG_ERROR;
    9092    }
    9193
     
    98100        print STDERR "failed to read request_file $req_file" ;
    99101        stop_request($req_id, $PS_EXIT_CONFIG_ERROR, $dbname);
    100         exit  $PS_EXIT_CONFIG_ERROR;
    101102    }
    102103
     
    231232            print STDERR "Unable to perform $command error code: $error_code\n";
    232233            $request_fault = $error_code >> 8;
     234            # fall through to stop the request
    233235        }
    234236    }
     
    258260        die("Unable to perform $command error code: $error_code");
    259261    }
     262    exit $fault;
    260263}
    261264
Note: See TracChangeset for help on using the changeset viewer.