|
9 | 9 | use Monolog\Logger as Logger; |
10 | 10 | use Monolog\Handler\StreamHandler; |
11 | 11 | use Monolog\Handler\RotatingFileHandler; |
| 12 | +use Jira\Api\Exception as Exception; |
12 | 13 | /** |
13 | 14 | * Interact jira server with REST API. |
14 | 15 | * @author Artur (Seti) Łabudziński |
@@ -133,7 +134,7 @@ protected function filterNullVariable($haystack) |
133 | 134 | * @param null $custom_request |
134 | 135 | * |
135 | 136 | * @return string |
136 | | - * @throws JIRAException |
| 137 | + * @throws Exception |
137 | 138 | */ |
138 | 139 | public function exec($context, $post_data = null, $custom_request = null, $tries = 3) |
139 | 140 | { |
@@ -203,14 +204,14 @@ public function exec($context, $post_data = null, $custom_request = null, $tries |
203 | 204 | } |
204 | 205 | // HostNotFound, No route to Host, etc Network error |
205 | 206 | $this->log->addError('CURL Error: = '.$body); |
206 | | - throw new JiraException('CURL Error: = '.$body); |
| 207 | + throw new Exception('CURL Error: = '.$body); |
207 | 208 | } else { |
208 | 209 | // if request was ok, parsing http response code. |
209 | 210 | $this->http_response = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
210 | 211 | curl_close($ch); |
211 | 212 | // don't check 301, 302 because setting CURLOPT_FOLLOWLOCATION |
212 | 213 | if ($this->http_response != 200 && $this->http_response != 201) { |
213 | | - throw new JiraException('CURL HTTP Request Failed: Status Code : ' |
| 214 | + throw new Exception('CURL HTTP Request Failed: Status Code : ' |
214 | 215 | .$this->http_response.', URL:'.$url |
215 | 216 | ."\nError Message : ".$response, $this->http_response); |
216 | 217 | } |
@@ -281,7 +282,7 @@ private function createUploadHandle($url, $upload_file) |
281 | 282 | * @param array $filePathArray upload file path. |
282 | 283 | * |
283 | 284 | * @return array |
284 | | - * @throws JiraException |
| 285 | + * @throws Exception |
285 | 286 | */ |
286 | 287 | public function upload($context, $filePathArray) |
287 | 288 | { |
@@ -344,7 +345,7 @@ public function upload($context, $filePathArray) |
344 | 345 | curl_multi_close($mh); |
345 | 346 | if ($result_code != 200) { |
346 | 347 | // @TODO $body might have not been defined |
347 | | - throw new JIRAException('CURL Error: = '.$body, $result_code); |
| 348 | + throw new Exception('CURL Error: = '.$body, $result_code); |
348 | 349 | } |
349 | 350 | return $results; |
350 | 351 | } |
|
0 commit comments