Skip to content

Commit 457bf43

Browse files
author
Artur Łabudziński
committed
Anotehr Fixes for vendor to work.
1 parent a40df5f commit 457bf43

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/Account/AccountService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function addGroupUser($name, $userName)
1616

1717
try {
1818
$ret = $this->exec($this->uri.'/user?groupname=' . $name, $json, 'POST');
19-
} catch (\Jira\Api\JIRAException $e) {
19+
} catch (\Jira\Api\Exception $e) {
2020
$code = $e -> getCode();
2121
$err = $e -> getMessage();
2222

@@ -44,7 +44,7 @@ public function removeGroupUser($name, $userName)
4444
{
4545
$ret = $this->exec($this->uri.'/user?username='.$userName.'&groupname=' . $name, null , 'DELETE');
4646
}
47-
catch (\Jira\Api\JIRAException $e)
47+
catch (\Jira\Api\Exception $e)
4848
{
4949
$code = $e -> getCode();
5050
$err = $e -> getMessage();

src/Client.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Monolog\Logger as Logger;
1010
use Monolog\Handler\StreamHandler;
1111
use Monolog\Handler\RotatingFileHandler;
12+
use Jira\Api\Exception as Exception;
1213
/**
1314
* Interact jira server with REST API.
1415
* @author Artur (Seti) Łabudziński
@@ -133,7 +134,7 @@ protected function filterNullVariable($haystack)
133134
* @param null $custom_request
134135
*
135136
* @return string
136-
* @throws JIRAException
137+
* @throws Exception
137138
*/
138139
public function exec($context, $post_data = null, $custom_request = null, $tries = 3)
139140
{
@@ -203,14 +204,14 @@ public function exec($context, $post_data = null, $custom_request = null, $tries
203204
}
204205
// HostNotFound, No route to Host, etc Network error
205206
$this->log->addError('CURL Error: = '.$body);
206-
throw new JiraException('CURL Error: = '.$body);
207+
throw new Exception('CURL Error: = '.$body);
207208
} else {
208209
// if request was ok, parsing http response code.
209210
$this->http_response = curl_getinfo($ch, CURLINFO_HTTP_CODE);
210211
curl_close($ch);
211212
// don't check 301, 302 because setting CURLOPT_FOLLOWLOCATION
212213
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 : '
214215
.$this->http_response.', URL:'.$url
215216
."\nError Message : ".$response, $this->http_response);
216217
}
@@ -281,7 +282,7 @@ private function createUploadHandle($url, $upload_file)
281282
* @param array $filePathArray upload file path.
282283
*
283284
* @return array
284-
* @throws JiraException
285+
* @throws Exception
285286
*/
286287
public function upload($context, $filePathArray)
287288
{
@@ -344,7 +345,7 @@ public function upload($context, $filePathArray)
344345
curl_multi_close($mh);
345346
if ($result_code != 200) {
346347
// @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);
348349
}
349350
return $results;
350351
}

src/Exception.php

-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ class Exception extends \Exception
99

1010
}
1111

12-
/**
13-
* Nazwany wyjątek dla Jiry
14-
*/
15-
class JIRAException extends Exception {}

0 commit comments

Comments
 (0)