IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2007, 9:36:41 AM (19 years ago)
Author:
eugene
Message:

improving the error handling: detect data vs config errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStats/src/ppStatsStandAlone.c

    r13628 r13640  
    5252        } else {
    5353            psErrorStackPrint(stderr, "Unable to open output file %s.\n", resolved);
    54             psFree(resolved);
    55             status = PS_EXIT_CONFIG_ERROR;
    56             goto die;
     54            exit(PS_EXIT_CONFIG_ERROR);
    5755        }
    5856        psFree(resolved);
     
    6058
    6159    // Go through the FPA and do the hard work
    62     psMetadata *results = ppStatsLoop(NULL, data, config);
     60    psMetadata *results = ppStatsLoop(&status, NULL, data, config);
     61    if (status != PS_EXIT_SUCCESS) {
     62        psErrorStackPrint(stderr, "Error in stats loop.\n");
     63        exit (status);
     64    }
    6365    if (psListLength(results->list) == 0) {
    6466        psErrorStackPrint(stderr, "No output.\n");
    65         psFree(results);
    66         status = PS_EXIT_DATA_ERROR;
    67         goto die;
     67        exit (status);
    6868    }
    6969
     
    7878        psErrorStackPrint(stderr, "Unable to generate configuration file with result.\n");
    7979        psFree(results);
    80         status = PS_EXIT_CONFIG_ERROR;
    81         goto die;
     80        exit(PS_EXIT_CONFIG_ERROR);
    8281    }
    8382    fprintf(outFile, "%s", output);
Note: See TracChangeset for help on using the changeset viewer.