This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 10
10
use InvalidArgumentException ;
11
11
use Guzzle \Http \Client as Guzzle3Client ;
12
12
use Guzzle \Http \ClientInterface as Guzzle3ClientInterface ;
13
+ use Guzzle \Http \Exception \ClientErrorResponseException ;
13
14
use GuzzleHttp \Client as Guzzle456Client ;
14
15
use GuzzleHttp \ClientInterface as Guzzle456ClientInterface ;
15
16
use ZendDiagnostics \Result \Failure ;
@@ -85,15 +86,19 @@ public function check()
85
86
*/
86
87
private function guzzle3Check ()
87
88
{
88
- $ response = $ this ->guzzle
89
- ->createRequest (
90
- $ this ->method ,
91
- $ this ->url ,
92
- $ this ->headers ,
93
- $ this ->body ,
94
- array_merge (['exceptions ' => false ], $ this ->options )
95
- )
96
- ->send ();
89
+ try {
90
+ $ response = $ this ->guzzle
91
+ ->createRequest (
92
+ $ this ->method ,
93
+ $ this ->url ,
94
+ $ this ->headers ,
95
+ $ this ->body ,
96
+ array_merge (['exceptions ' => false ], $ this ->options )
97
+ )
98
+ ->send ();
99
+ } catch (ClientErrorResponseException $ e ) {
100
+ $ response = $ e ->getResponse ();
101
+ }
97
102
98
103
if ($ this ->statusCode !== ($ statusCode = $ response ->getStatusCode ())) {
99
104
return $ this ->createStatusCodeFailure ($ statusCode );
You can’t perform that action at this time.
0 commit comments