IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12572


Ignore:
Timestamp:
Mar 23, 2007, 1:25:02 PM (19 years ago)
Author:
Paul Price
Message:

Supplementing errors with more useful info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r12542 r12572  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.157 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2007-03-22 15:34:04 $
     14 *  @version $Revision: 1.158 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2007-03-23 23:25:02 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    463463        psMetadataItem *newItem = psMetadataItemCopy(inItem); // Copied item
    464464        if (!psMetadataAddItem(out, newItem, PS_LIST_TAIL, flag)) {
    465             psError(PS_ERR_UNKNOWN, false, "Error copying %s (%s) in the metadata\n", 
    466                     inItem->name, inItem->comment);
     465            psError(PS_ERR_UNKNOWN, false, "Error copying %s (%s) in the metadata\n",
     466                    inItem->name, inItem->comment);
    467467            if (outAlloced) {
    468468                psFree(out);
     
    488488// if any entries in 'in' a) do not exist in 'out' or b) have a different type
    489489bool p_psMetadataUpdate(const char *file,
    490                         unsigned int lineno,
    491                         const char *func,
    492                         psMetadata *out,
    493                         const psMetadata *in)
     490                        unsigned int lineno,
     491                        const char *func,
     492                        psMetadata *out,
     493                        const psMetadata *in)
    494494{
    495495    PS_ASSERT_METADATA_NON_NULL(in, NULL);
     
    513513        psMetadataItem *newItem = psMetadataItemCopy(inItem); // Copied item
    514514        if (!psMetadataAddItem(out, newItem, PS_LIST_TAIL, flag)) {
    515             fprintf (stderr, "Error copying %s\n", inItem->name);
    516             result = false;
     515            fprintf (stderr, "Error copying %s\n", inItem->name);
     516            result = false;
    517517        }
    518518        psFree(newItem);                // Drop reference
     
    521521
    522522    if (!result) {
    523         psError(PS_ERR_UNKNOWN, false, "failed to update metadata\n");
    524     }               
     523        psError(PS_ERR_UNKNOWN, false, "failed to update metadata\n");
     524    }
    525525    return result;
    526526}
     
    614614            // replace entry instead of creating a duplicate entry.
    615615
    616             if ((flags & PS_META_REQUIRE_TYPE) && (existingEntry->type != item->type)) {
    617                 psError (PS_ERR_UNKNOWN, true, _("existing item does not match type for item requiring matching type"));
    618                 return false;
    619             }
     616            if ((flags & PS_META_REQUIRE_TYPE) && (existingEntry->type != item->type)) {
     617                psError (PS_ERR_UNKNOWN, true, _("Existing item %s does not match type (%x) for item requiring matching type (%x)"), key, existingEntry->type, item->type);
     618                return false;
     619            }
    620620
    621621            // remove the existing entry from metadata
     
    647647    } else {
    648648        // OK, this is a new item.
    649         if (flags & PS_META_REQUIRE_ENTRY) {
    650             psError (PS_ERR_UNKNOWN, true, _("no matching item found for item requiring existing entry"));
    651             return false;
    652         }
     649        if (flags & PS_META_REQUIRE_ENTRY) {
     650            psError (PS_ERR_UNKNOWN, true, _("No matching item found for item requiring existing entry (%s)"),
     651                     key);
     652            return false;
     653        }
    653654
    654655        // Node doesn't exist - Add new metadata item to metadata collection's hash
Note: See TracChangeset for help on using the changeset viewer.