yii异常处理架构

 

使用方法:

use \yii\base\ErrorException;
try {
	exec("curl http://xxx",$out,$retno);
	if(0 !== $retno){
	throw new ErrorException(var_export($out,true),0,1,__FILE__,__LINE__);
} catch (ErrorException $e){
	$error = "{$date} - {$e->getMessage()} - FILE:{$e->getFile()} - LINE:{$e->getLine()}\n";
}

 

posted @ 2017-12-25 10:38  lglblog  阅读(116)  评论(0编辑  收藏  举报