I have the following function:
public function getClientTable($feedUrl)
{
    $client = new Zend_Http_Client($feedUrl);
    try
    {
        return $client->request()->getBody();
    }
    catch (Zend_Http_Client_Adapter_Exception $e)
    {
        return false;
    }
}
It seems to work great for catching th开发者_运维技巧at specific Zend_Http_Client_Adapter_Exception; but what if I want it to catch additional exceptions? Hell, what if I wanted it to catch ALL exceptions... how would I do this?
Also, should I be using "return" or "throw" in the try? Why does it matter?
You can have multiple catch statements, eg
try { 
    // whatever
} catch (Zend_Http_Client_Adapter_Exception $e) {
    // ah ha
} catch (Zend_Some_other_Exception $e) {
    // ah ha
} catch (Exception $e) {
    // And the final fallback catch that grabs all exceptions
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论