Changeset 5333

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

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

Location:
branches
Files:
2 modified

Legend:

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

    r5015 r5333  
    142142                if ($field = $this->_getCustomIndexField($rootAlias)) { 
    143143                    if (isset($result[$field])) { 
    144                         throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping."); 
     144                        throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping named '$field'."); 
    145145                    } else if ( ! isset($element[$field])) { 
    146                         throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key."); 
     146                        throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key named '$field'."); 
    147147                    } 
    148148                    $result[$element[$field]] = $element; 
     
    208208                            if ($field = $this->_getCustomIndexField($dqlAlias)) { 
    209209                                if (isset($prev[$parent][$relationAlias][$element[$field]])) { 
    210                                     throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping."); 
     210                                    throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found non-unique key mapping named '$field'."); 
    211211                                } else if ( ! isset($element[$field])) { 
    212                                     throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key."); 
     212                                    throw new Doctrine_Hydrator_Exception("Couldn't hydrate. Found a non-existent key named '$field'."); 
    213213                                } 
    214214                                $prev[$parent][$relationAlias][$element[$field]] = $element; 
  • 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;