IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33360


Ignore:
Timestamp:
Feb 24, 2012, 7:50:04 AM (14 years ago)
Author:
eugene
Message:

add better error checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c

    r33314 r33360  
    462462  // load the list of hosts
    463463  SkyTable *sky = GetSkyTable();
    464   if (!sky) return FALSE;
     464  if (!sky) {
     465    gprint (GP_ERR, "failed to load sky table for database\n");
     466    return FALSE;
     467  }
    465468
    466469  char *tmppath = GetCATDIR ();
    467   if (!tmppath) return FALSE;
     470  if (!tmppath) {
     471    gprint (GP_ERR, "failed to get CATDIR for database\n");
     472    return FALSE;
     473  }
    468474
    469475  char *CATDIR = abspath (tmppath, MAX_PATH_LENGTH);
    470   if (!CATDIR) return FALSE;
     476  if (!CATDIR) {
     477    gprint (GP_ERR, "failed to make an absolute path from %s (too long)\n", tmppath);
     478    return FALSE;
     479  }
    471480
    472481  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
    473482  if (!table) {
    474     fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
     483    gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
    475484    return FALSE;
    476485  }   
     
    485494  // determine time reference and format
    486495  char *TimeRef = get_variable ("TIMEREF");
    487   if (!TimeRef) return FALSE;
     496  if (!TimeRef) {
     497    gprint (GP_ERR, "failed to find TIMEREF variable\n");
     498    return FALSE;
     499  }
    488500
    489501  char *TimeFormat = get_variable ("TIMEFORMAT");
    490   if (!TimeFormat) return FALSE;
     502  if (!TimeFormat) {
     503    gprint (GP_ERR, "failed to find TIMEFORMAT variable\n");
     504    return FALSE;
     505  }
    491506
    492507  char tmp;
     
    502517
    503518  if (PARALLEL_MANUAL) {
    504     fprintf (stderr, "run the relphot_client commands above.  when these are done, hit return\n");
     519    gprint (GP_ERR, "run the relphot_client commands above.  when these are done, hit return\n");
    505520    getchar();
    506521  }
     
    528543  if (ResultFile) {
    529544    int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nvec, FALSE, NULL);
    530     if (!status) return FALSE;
     545    if (!status) {
     546      gprint (GP_ERR, "failed to write result file %s\n", ResultFile);
     547      return FALSE;
     548    }
    531549  }
    532550
Note: See TracChangeset for help on using the changeset viewer.