File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ public function doFileRequest(string $uri, array $params = [])
101101 return $ response ->getBody ()->getContents ();
102102 } catch (\GuzzleHttp \Exception \ClientException $ exception ) {
103103 if ($ exception ->getCode () == 401 ) {
104- throw new UnauthorizedException ('Request unauthorized ' );
104+ throw new UnauthorizedException ('Request unauthorized ' , 401 );
105105 }
106106
107- throw new \FreshMail \ApiV2 \ClientException (sprintf ( ' Connection error, error message: ' . $ exception ->getMessage () ));
107+ throw new \FreshMail \ApiV2 \ClientException ($ exception -> getMessage (), $ exception ->getResponse ()-> getStatusCode ( ));
108108 } catch (\GuzzleHttp \Exception \ConnectException $ exception ) {
109- throw new ConnectionException (sprintf ( ' Connection error, error message: ' . $ exception ->getMessage () ));
109+ throw new ConnectionException ($ exception ->getMessage ());
110110 }
111111 }
112112
You can’t perform that action at this time.
0 commit comments