IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 14, 2010, 3:53:21 PM (16 years ago)
Author:
rhenders
Message:

Improved error handling, specifically, now using standard IPP exit codes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/main.c

    r27345 r27684  
    1818    ippToPsps_VersionPrint();
    1919
    20     int ret = PS_EXIT_SUCCESS;
     20    int exitCode;
    2121
    2222    // create ippToPsps
    2323    IppToPsps *ippToPsps = ippToPsps_Constructor(&argc, argv);
    24 
    25     if (!ippToPsps) ret = PS_EXIT_CONFIG_ERROR;
    26     else {
    27 
    28         if (!ippToPsps->run(ippToPsps)) ret = PS_EXIT_DATA_ERROR;
    29         psFree(ippToPsps);
    30     }
     24    ippToPsps->run(ippToPsps);
     25    exitCode = ippToPsps->exitCode;
     26    psFree(ippToPsps);
    3127
    3228    double secs = psTimerMark("ippToPsps");
    3329
    34     psLogMsg("ippToPsps", 3, "ippToPsps completed %ssuccessfully in %.1f %s\n",
    35             (ret == PS_EXIT_SUCCESS) ? "" : "un",
     30    psLogMsg("ippToPsps", 3, "ippToPsps completed %ssuccessfully, with exit code %d, in %.1f %s\n",
     31            (exitCode == PS_EXIT_SUCCESS) ? "" : "un",
     32            exitCode,
    3633            (secs<60.0) ? secs : (secs/60.0),
    3734            (secs<60.0) ? "sec(s)" : "min(s)");
     
    4138    psLibFinalize();
    4239
    43     return ret;
     40    return exitCode;
    4441}
Note: See TracChangeset for help on using the changeset viewer.