Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PhantomJS:如何捕获返回的错误代码_Javascript_Yii_Phantomjs - Fatal编程技术网

Javascript PhantomJS:如何捕获返回的错误代码

Javascript PhantomJS:如何捕获返回的错误代码,javascript,yii,phantomjs,Javascript,Yii,Phantomjs,我试图在运行PhantomJS脚本后捕获错误代码 $result = ''; exec('/usr/bin/phantomjs ' . Yii::app()->basePath . '/commands/netsniff.js http://' . $model_url->location, $result); $result = join("\n", $result); if ($echo) { echo "json:\r\n"; print_r($result);

我试图在运行PhantomJS脚本后捕获错误代码

$result = '';
exec('/usr/bin/phantomjs ' . Yii::app()->basePath . '/commands/netsniff.js http://' . $model_url->location, $result);
$result = join("\n", $result);
if ($echo) {
    echo "json:\r\n";
    print_r($result);
}
如果url加载失败,我总是会遇到以下错误:

无法加载地址


我是否应该获得包含错误的
json

显示
$model\u url->location的值