Skip to content
Permalink
Browse files

Make stream error handling method public to handle errors in custom s…

…tream wrappers (#9001)
  • Loading branch information...
Marlinc authored and markstory committed Jun 18, 2016
1 parent 632a525 commit f7fb9b7aa047995a8c1f1556e1cef3772ecc971f
Showing with 3 additions and 14 deletions.
  1. +3 −14 src/Http/Client/Adapter/Stream.php
@@ -293,7 +293,9 @@ protected function _send(Request $request)
*/
protected function _open($url)
{
set_error_handler([$this, '_connectionErrorHandler']);
set_error_handler(function ($code, $message) {
$this->_connectionErrors[] = $message;
});
$this->_stream = fopen($url, 'rb', false, $this->_context);
restore_error_handler();
@@ -302,19 +304,6 @@ protected function _open($url)
}
}
/**
* Local error handler to capture errors triggered during
* stream connection.
*
* @param int $code Error code.
* @param string $message Error message.
* @return void
*/
protected function _connectionErrorHandler($code, $message)
{
$this->_connectionErrors[] = $message;
}
/**
* Get the context options
*

0 comments on commit f7fb9b7

Please sign in to comment.
You can’t perform that action at this time.