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/ippTools/src/pstamptool.c

    r25054 r25075  
    315315    PS_ASSERT_PTR_NON_NULL(config, false);
    316316
    317     PXOPT_LOOKUP_S64(req_id,  config->args, "-req_id", true, false);
     317    PXOPT_LOOKUP_S64(req_id,  config->args, "-req_id", false, false);
     318    PXOPT_LOOKUP_STR(name,  config->args, "-name", false, false);
    318319    PXOPT_LOOKUP_U64(limit,   config->args, "-limit",  false, false);
    319320    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     321
     322    if (!req_id && !name) {
     323        psError(PS_ERR_UNKNOWN, true, "-req_id or -name must be supplied");
     324        return false;
     325    }
    320326
    321327    psString query = NULL;
     
    342348    }
    343349    if (!psArrayLength(output)) {
    344         psTrace("pstamptool", PS_LOG_INFO, "no rows found");
    345         psFree(output);
    346         return true;
     350        psTrace("pstamptool", PS_LOG_INFO, "request not found");
     351        // This causes main to exit with PS_EXIT_DATA_ERROR which the script is looking for
     352        psError(PXTOOLS_ERR_DATA, true, "request not found");
     353        psFree(output);
     354        // we return false so that the caller can determine that a request does not exist
     355        return false;
    347356    }
    348357
Note: See TracChangeset for help on using the changeset viewer.