IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2009, 12:45:30 PM (17 years ago)
Author:
bills
Message:

New error codes for postage stamp server requests and jobs

File:
1 edited

Legend:

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

    r25068 r25075  
    9696my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
    9797
     98{
     99    my $command = "$pstamptool -listreq  -name $req_name";
     100    $command .= " -dbname $dbname" if $dbname;
     101    $command .= " -dbserver $dbserver" if $dbserver;
     102    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     103        run(command => $command, verbose => $verbose);
     104    my $exitStatus = $error_code >> 8;
     105    if ($success) {
     106        # -listreq succeeded duplicate request name
     107        insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST);
     108        exit 0;
     109    } elsif ($exitStatus ne $PS_EXIT_DATA_ERROR) {
     110        # wrong error code something else is wrong
     111        my_die("$command failed", $exitStatus);
     112    }
     113}
     114
    98115if ($req_id and !$no_update) {
    99116    # update the database with the request name. This will be used as the
     
    152169    if (!$proj_hash) {
    153170        print STDERR "project $project not found\n"  if $verbose;
    154         insertFakeJobForRow($row, 1, 46);
     171        insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT);
    155172        $num_jobs++;
    156173        next;
     
    173190    if (!$skycenter and !$search_component) {
    174191        print STDERR "COMPONENT must be specified for pixel coordinate ROI\n" if $verbose;
    175         insertFakeJobForRow($row, 1, 45);
     192        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    176193        $num_jobs++;
    177194        next;
     
    182199    if (($job_type eq "stamp") and ! validROI($row)) {
    183200        print STDERR "invalid ROI for row $rownum\n" if $verbose;
    184         insertFakeJobForRow($row, 1, 46);
     201        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    185202        $num_jobs++;
    186203        next;
     
    221238        if (!$skycenter) {
    222239            print STDERR "center must be specified in sky coordintes for bycoord" if $verbose;
    223             insertFakeJobForRow($row, 1, 46);
     240            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    224241            $num_jobs++;
    225242            next;
    226243        }
    227244        print STDERR "lookup bycoord is not yet implemented" if $verbose;
    228         insertFakeJobForRow($row, 1, 47);
     245        insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
    229246        $num_jobs++;
    230247        next;
     
    250267if (($mode eq "queue_jobs") and ($num_jobs eq 0)) {
    251268    print STDERR "no jobs created for $req_name\n" if $verbose;
    252     insertFakeJobForRow(undef, 1, 41);
     269    insertFakeJobForRow(undef, 0, $PSTAMP_UNKNOWN_ERROR);
    253270}
    254271
     
    272289    if ( $numComponents == 0 ) {
    273290        print STDERR "no jobs for row $rownum\n" if $verbose;
    274         insertFakeJobForRow($row, 1, 44);
     291        insertFakeJobForRow($row, 1, $PSTAMP_NO_JOBS_QUEUED);
    275292        return 1;
    276293    }
     
    319336            # for now assume yes.
    320337
    321             insertFakeJobForRow($row, $job_num, 43);
     338            insertFakeJobForRow($row, $job_num, $PSTAMP_NOT_DESTREAKED);
    322339
    323340            next;
     
    417434        print STDERR "get_image jobs not implemented yet" if $verbose;
    418435        foreach my $row (@$rowList) {
    419             insertFakeJobForRow($row, 1, 47);
     436            insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
    420437            $num_jobs++;
    421438        }
     
    425442            # the status back to the requestor
    426443            foreach my $row (@$rowList) {
    427                 insertFakeJobForRow($row, 1, 42);
     444                insertFakeJobForRow($row, 1, $PSTAMP_NO_IMAGE_MATCH);
    428445                $num_jobs++;
    429446            }
     
    605622        # if first row has no component all of the images will be retrieved, so
    606623        # the fact that this row has a component is ok. Fall through to return 1
    607         # return 0;
     624        # XXX Nope that doesn't work (yet)
     625        return 0;
    608626    }
    609627
Note: See TracChangeset for help on using the changeset viewer.