Changeset 17852

Show
Ignore:
Timestamp:
10/02/08 00:21:50 (2 months ago)
Author:
solt
Message:

more exception handles

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/core/user.php

    r17830 r17852  
    219219            $this->_storage = new midgard_person(); 
    220220            $id = substr($id, 5); 
    221             if (! $this->_storage->get_by_guid($id)) 
    222             { 
    223                 debug_push_class(__CLASS__, __FUNCTION__); 
    224                 debug_add("Failed to retrieve the person GUID {$id}: " . mgd_errstr(), MIDCOM_LOG_INFO); 
    225                 debug_pop(); 
    226                 return false; 
    227             } 
    228         } 
    229         else if (mgd_is_guid($id)) 
    230         { 
    231             $this->_storage = new midgard_person(); 
    232221            try 
    233222            { 
     
    242231            } 
    243232        } 
     233        else if (mgd_is_guid($id)) 
     234        { 
     235            $this->_storage = new midgard_person(); 
     236            try  
     237            { 
     238                $this->_storage->get_by_guid($id); 
     239            } 
     240            catch (midgard_error_exception $e)  
     241            { 
     242                debug_push_class(__CLASS__, __FUNCTION__); 
     243                debug_add("Failed to retrieve the person GUID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO); 
     244                debug_pop(); 
     245                return false; 
     246            } 
     247        } 
    244248        else if (is_numeric($id)) 
    245249        { 
    246250            $this->_storage = new midgard_person(); 
    247  
    248             try { 
    249  
     251            try  
     252            { 
    250253                $this->_storage->get_by_id($id); 
    251  
    252             } catch (midgard_error_exception $e) { 
    253  
     254            } 
     255            catch (midgard_error_exception $e)  
     256            { 
    254257                debug_push_class(__CLASS__, __FUNCTION__); 
    255258                debug_add("Failed to retrieve the person ID {$id}: " . $e->getMessage(), MIDCOM_LOG_INFO);