Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
76900b35
Commit
76900b35
authored
Jan 20, 2013
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added curl_error output to HTTP exception in the Curl handler
parent
1ad04795
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
library/Solarium/Core/Client/Adapter/Curl.php
library/Solarium/Core/Client/Adapter/Curl.php
+4
-3
No files found.
library/Solarium/Core/Client/Adapter/Curl.php
View file @
76900b35
...
@@ -120,8 +120,8 @@ class Curl extends Configurable implements AdapterInterface
...
@@ -120,8 +120,8 @@ class Curl extends Configurable implements AdapterInterface
$data
=
''
;
$data
=
''
;
}
}
$this
->
check
(
$data
,
$headers
,
$handle
);
curl_close
(
$handle
);
curl_close
(
$handle
);
$this
->
check
(
$data
,
$headers
);
return
new
Response
(
$data
,
$headers
);
return
new
Response
(
$data
,
$headers
);
// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
...
@@ -219,14 +219,15 @@ class Curl extends Configurable implements AdapterInterface
...
@@ -219,14 +219,15 @@ class Curl extends Configurable implements AdapterInterface
* @throws HttpException
* @throws HttpException
* @param string $data
* @param string $data
* @param array $headers
* @param array $headers
* @param Curl handle $handle
* @return void
* @return void
*/
*/
public
function
check
(
$data
,
$headers
)
public
function
check
(
$data
,
$headers
,
$handle
)
{
{
// if there is no data and there are no headers it's a total failure,
// if there is no data and there are no headers it's a total failure,
// a connection to the host was impossible.
// a connection to the host was impossible.
if
(
empty
(
$data
)
&&
count
(
$headers
)
==
0
)
{
if
(
empty
(
$data
)
&&
count
(
$headers
)
==
0
)
{
throw
new
HttpException
(
"HTTP request failed"
);
throw
new
HttpException
(
'HTTP request failed, '
.
curl_error
(
$handle
)
);
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment