使用方法:
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";
}
共 1 条评论
你写得自己看懂吗