English 中文(简体)
在我收到警告和页码时,空洞的错误处理从装载物中进一步停止。
原标题:Fsockopen error handling, at the moment I get warnings and page stops further content from loading

我有以下法典:

$open_socket = fsockopen($host,$port,$errno,$errstr,30);
if(!$open_socket){
    echo "$errstr ($errno)<br />".$nl;
}else{
    fputs($open_socket,$xml);
    while(!feof($open_socket)){
        $line = fgets($open_socket,128);
        $return_xml.= $line;
    }
    fclose($open_socket);
}

但如果没有联系,我收到以下信息:

警告:

该网页的其余部分是空白的,基本上我如何能够在我的网页上继续播放,只展示错误信息,而不是发出警告。

增 编

最佳回答

你们可以提出警告,呼吁开裂

$open_socket = @fsockopen($host,$port,$errno,$errstr,30);
问题回答

暂无回答




相关问题
Separating Business Layer Errors from API errors

The title is horrible, i know; I m terrible at titles on SO here. I m wondering what would be the best way to present unified error responses in a webapi when errors could be raised deep inside the ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

How to tell why a file deletion fails in Java?

File file = new File(path); if (!file.delete()) { throw new IOException( "Failed to delete the file because: " + getReasonForFileDeletionFailureInPlainEnglish(file)); } Is there a ...

Exceptions: redirect or render?

I m trying to standardize the way I handle exceptions in my web application (homemade framework) but I m not certain of the "correct" way to handle various situations. I m wondering if there is a ...

热门标签