<code>/**
* 获得银行卡
* @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';
}
}
</code>为什么yii 抛出的异常是yiibaseerrorexception ? 我的exception 系统异常也捕获不了 yii抛出的异常? 如何解决既能捕获系统异常也能捕获yii的 yiibaseerrorexception 异常呢?
<code>/**
* 获得银行卡
* @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';
}
}
</code>为什么yii 抛出的异常是yiibaseerrorexception ? 我的exception 系统异常也捕获不了 yii抛出的异常? 如何解决既能捕获系统异常也能捕获yii的 yiibaseerrorexception 异常呢?
可能是你的PHP版本太低了,记得一次PHP版本升级note里有说修复一下异常的问题;
我用PHP5.5试了,不出现你说的问题。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号