Skip to content

Commit f73287f

Browse files
committed
Use proper type of exception for client problems.
1 parent a831918 commit f73287f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/PleskX/Api/Client.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Copyright 1999-2016. Parallels IP Holdings GmbH.
33

44
namespace PleskX\Api;
5-
use PleskX\Api\Client\Exception;
65
use SimpleXMLElement;
76

87
/**
@@ -152,7 +151,7 @@ public function request($request, $mode = self::RESPONSE_SHORT)
152151
*
153152
* @param string $request
154153
* @return XmlResponse
155-
* @throws Exception
154+
* @throws Client\Exception
156155
*/
157156
private function _performHttpRequest($request)
158157
{
@@ -194,6 +193,7 @@ private function _performHttpRequest($request)
194193
* @param $requests
195194
* @param int $mode
196195
* @return array
196+
* @throws Client\Exception
197197
*/
198198
public function multiRequest($requests, $mode = self::RESPONSE_SHORT)
199199
{
@@ -202,7 +202,7 @@ public function multiRequest($requests, $mode = self::RESPONSE_SHORT)
202202

203203
foreach ($requests as $request) {
204204
if ($request instanceof SimpleXMLElement) {
205-
throw new Exception('SimpleXML type of request is not supported for multi requests.');
205+
throw new Client\Exception('SimpleXML type of request is not supported for multi requests.');
206206
} else {
207207
if (is_array($request)) {
208208
$request = $this->_arrayToXml($request, $requestXml)->asXML();
@@ -214,7 +214,7 @@ public function multiRequest($requests, $mode = self::RESPONSE_SHORT)
214214
}
215215

216216
if ('sdk' == $this->_protocol) {
217-
throw new Exception('Multi requests are not supported via SDK.');
217+
throw new Client\Exception('Multi requests are not supported via SDK.');
218218
} else {
219219
$responseXml = $this->_performHttpRequest($requestXml->asXML());
220220
}
@@ -281,7 +281,7 @@ public static function getExecutionLog()
281281
* Verify that response does not contain errors
282282
*
283283
* @param XmlResponse $xml
284-
* @throws \Exception
284+
* @throws Exception
285285
*/
286286
protected function _verifyResponse($xml)
287287
{

0 commit comments

Comments
 (0)