IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2007, 5:18:21 PM (19 years ago)
Author:
magnier
Message:

correctly handle invalid camera format vs config error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r11226 r11242  
    267267    psArray *infiles = psMetadataLookupPtr(&status, config->arguments, argname);
    268268    if (!status) {
    269         //        psTrace("psModules.camera", 5, "Failed to find %s in argument list", argname);
    270269        psError(PS_ERR_UNEXPECTED_NULL, false, "Failed to find %s in argument list", argname);
    271270        return NULL;
     
    326325        return NULL;
    327326    }
     327    file->format = format;
    328328
    329329    // adjust the rules to identify these files in the file->names data
     
    373373                return NULL;
    374374            }
    375             if (!pmConfigValidateCameraFormat (format, phu)) {
     375            bool valid = false;
     376            if (!pmConfigValidateCameraFormat (&valid, format, phu)) {
     377                psError (PS_ERR_UNKNOWN, false, "Error in config scripts\n");
     378                psFree (realName);
     379                psFitsClose (fits);
     380                return NULL;
     381            }
     382            if (!valid) {
    376383                psError(PS_ERR_IO, false, "file %s is not from the required camera", realName);
    377384                psFree (realName);
     
    404411    }
    405412    psFree (fpa);
    406 
    407     file->format = format;
    408413    if (found)
    409414        *found = true;
     
    492497            return NULL;
    493498        }
    494         if (!pmConfigValidateCameraFormat (input->format, phu)) {
     499        bool valid = false;
     500        if (!pmConfigValidateCameraFormat (&valid, input->format, phu)) {
     501            psError (PS_ERR_UNKNOWN, false, "Error in config scripts\n");
     502            psFree (realName);
     503            psFitsClose (fits);
     504            return NULL;
     505        }
     506        if (!valid) {
    495507            psError(PS_ERR_IO, false, "specified data file %s does not match format of supplied INPUT\n", realName);
    496508            psFree (realName);
Note: See TracChangeset for help on using the changeset viewer.