Show
Ignore:
Timestamp:
01/05/09 15:00:05 (19 months ago)
Author:
jwage
Message:

[1.0, 1.1] Makes hydrator exceptions more verbose (closes #1800)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1/lib/Doctrine/Hydrator.php

    r5073 r5333  
    170170                if ($field = $this->_getCustomIndexField($rootAlias)) { 
    171171                    if (isset($result[$field])) { 
    172                         throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping."); 
     172                        throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping named '$field'."); 
    173173                    } else if ( ! isset($element[$field])) { 
    174                         throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key."); 
     174                        throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key named '$field'."); 
    175175                    } 
    176176                    $result[$element[$field]] = $element; 
     
    238238                            if ($field = $this->_getCustomIndexField($dqlAlias)) { 
    239239                                if (isset($prev[$parent][$relationAlias][$element[$field]])) { 
    240                                     throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping."); 
     240                                    throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping named '$field'."); 
    241241                                } else if ( ! isset($element[$field])) { 
    242                                     throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key."); 
     242                                    throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key named '$field'."); 
    243243                                } 
    244244                                $prev[$parent][$relationAlias][$element[$field]] = $element;