yii2 try cactch没有捕获异常,为什么

如题所述

* @param array $data
* @return string
*/
public function getBank($data) {
try {
$client = $this->getClient();
$params = $this->getConnectParams(array('username' => $data['username']));
$response = $client->GetBank($params);
$return_json = $response->GetBankResult;
$return_arr = json_decode($return_json) ;
$status = $return_arr->result ;
} catch (\Exception $e) {
self::addLog($e);
$status = 'error';
}
}
温馨提示:答案为网友推荐,仅供参考