improve error handling

This commit is contained in:
Robin Appelman 2021-03-02 19:06:04 +01:00
commit 26ec766638
3 changed files with 10 additions and 12 deletions

View file

@ -101,14 +101,9 @@ class RawConnection {
* @param string $input
*/
public function write($input) {
if (@fwrite($this->getInputStream(), $input) === false) {
$error = error_get_last();
if ($error && strpos($error['message'], "errno=32")) {
error_clear_last();
throw new ConnectionResetException();
}
}
$result = @fwrite($this->getInputStream(), $input);
fflush($this->getInputStream());
return $result;
}
/**