IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 25, 2010, 4:26:50 PM (16 years ago)
Author:
Paul Price
Message:

Reworking error codes to get consistent exit codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpDefineSkycell.c

    r21323 r27096  
    4747    }
    4848    if (infiles->n != 1) {
    49         psError(PS_ERR_IO, false, "Found n == %ld files in %s in arguments\n", infiles->n, argname);
     49        psError(PSWARP_ERR_CONFIG, false, "Found n == %ld files in %s in arguments\n", infiles->n, argname);
    5050        return false;
    5151    }
     
    5454    psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false);
    5555    if (!realName) {
    56         psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
     56        psError(psErrorCodeLast(), false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
    5757        return false;
    5858    }
     
    6161    fits = psFitsOpen (realName, "r");
    6262    if (!fits) {
    63         psError(PS_ERR_IO, false, "Failed to open file %s\n", realName);
     63        psError(psErrorCodeLast(), false, "Failed to open file %s\n", realName);
    6464        psFree (realName);
    6565        return false;
     
    6767    phu = psFitsReadHeader (NULL, fits);
    6868    if (!phu) {
    69         psError(PS_ERR_IO, false, "Failed to read file header %s\n", realName);
     69        psError(psErrorCodeLast(), false, "Failed to read file header %s\n", realName);
    7070        psFree (realName);
    7171        return false;
     
    8787    format = pmConfigCameraFormatFromHeader (NULL, NULL, NULL, skyConfig, phu, false);
    8888    if (!format) {
    89         psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
     89        psError(psErrorCodeLast(), false, "Failed to read CCD format from %s\n", realName);
    9090        psFree(phu);
    9191        psFree (realName);
     
    100100    fpa = pmFPAConstruct (skyConfig->camera, skyConfig->cameraName);
    101101    if (!fpa) {
    102         psError(PS_ERR_IO, false, "Failed to construct FPA from %s", realName);
     102        psError(psErrorCodeLast(), false, "Failed to construct FPA from %s", realName);
    103103        psFree (realName);
    104104        return false;
     
    110110    file = pmFPAfileDefineInput (skyConfig, fpa, NULL, filename);
    111111    if (!file) {
    112         psError(PS_ERR_IO, false, "file %s not defined\n", filename);
     112        psError(psErrorCodeLast(), false, "file %s not defined\n", filename);
    113113        psFree(phu);
    114114        psFree(fpa);
     
    126126    file->fileLevel = pmFPAPHULevel(format);
    127127    if (file->fileLevel == PM_FPA_LEVEL_NONE) {
    128         psError(PS_ERR_IO, true, "Unable to determine file level for %s\n", file->name);
     128        psError(PSWARP_ERR_CONFIG, true, "Unable to determine file level for %s\n", file->name);
    129129        psFree(phu);
    130130        psFree(fpa);
     
    137137    pmFPAview *view = pmFPAAddSourceFromHeader (fpa, phu, format);
    138138    if (!view) {
    139         psError(PS_ERR_IO, false, "Unable to determine source for %s", file->name);
     139        psError(psErrorCodeLast(), false, "Unable to determine source for %s", file->name);
    140140        psFree(phu);
    141141        psFree (fpa);
Note: See TracChangeset for help on using the changeset viewer.