Changeset 17524
- Timestamp:
- May 4, 2008, 2:22:07 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfig.c
r17510 r17524 1319 1319 } 1320 1320 1321 // XXX this is a prime example of the failing of our error-handling system. this function has 1322 // three possible outcomes: the argument was found, it was not found, or we raised an error. 1323 // returning only the bool does not distinguish failure to find the argument from a deeper 1324 // error. requiring the calling function to both test the bool AND trap the error stack is 1325 // fragile: the error stack may not have been cleared, or they may not do both. in some 1326 // places, we solve this by returning two types of boolean status values. a better option 1327 // might be to return a psErrorCode value (as RHL proposed), which would be 0 on success and 1328 // any of several options on failure. 1329 1321 1330 bool pmConfigFileSetsMD(psMetadata *metadata, int *argc, char **argv, const char *name, 1322 1331 const char *file, const char *list) … … 1328 1337 // if files->n == 0 we'll want to call psError(..., false, ...) 1329 1338 psArray *files = pmConfigFileSets(argc, argv, file, list); 1339 if (!files) { 1340 psAbort("error parsing argument list"); 1341 psError(PS_ERR_IO, false, "error parsing argument list"); 1342 psFree (files); 1343 return false; 1344 } 1345 1346 // no files found: this is not really an error 1330 1347 if (files->n == 0) { 1331 // psError(PS_ERR_IO, false, "pmConfigFileSets failed to find %s in the argument list", name);1332 1348 psFree (files); 1333 1349 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
