jirasync 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,15 @@ module JiraSync
5
5
  require 'json'
6
6
 
7
7
  class FetchError < StandardError
8
- attr_reader :status, :message
8
+ attr_reader :status, :url
9
9
 
10
- def initialize(status, message)
10
+ def initialize(status, url)
11
11
  @reason = status
12
- @message = message
12
+ @url= url
13
+ end
14
+
15
+ def to_s
16
+ "Got status #{status} for #{url}"
13
17
  end
14
18
  end
15
19
 
@@ -29,7 +33,7 @@ module JiraSync
29
33
  if response.code == 200
30
34
  response.parsed_response
31
35
  else
32
- raise FetchError.new(response.code, "error retrieving #{jira_id}. response code was #{response.code}, url was #{url}")
36
+ raise FetchError.new(response.code, url)
33
37
  end
34
38
  end
35
39
 
@@ -41,7 +45,7 @@ module JiraSync
41
45
  if response.code == 200
42
46
  response.parsed_response
43
47
  else
44
- raise FetchError.new(response.status, "no issue found for #{project_id}. response code was #{response.code}, url was #{url}")
48
+ raise FetchError.new(response.status, url)
45
49
  end
46
50
  end
47
51
 
@@ -54,7 +58,7 @@ module JiraSync
54
58
  if response.code == 200
55
59
  response.parsed_response
56
60
  else
57
- raise FetchError.new(response.status, "no issue found for #{project_id}. response code was #{response.code}, url was #{url}")
61
+ raise FetchError.new(response.status, url)
58
62
  end
59
63
  end
60
64
 
@@ -65,7 +69,7 @@ module JiraSync
65
69
  if response.code == 200
66
70
  response.parse_response
67
71
  else
68
- raise "no issue found for #{project_id}. response code was #{response.code}, url was #{url}"
72
+ raise FetchError(response.status, url)
69
73
  end
70
74
 
71
75
  end
@@ -34,6 +34,8 @@ module JiraSync
34
34
  if (e.status != 404)
35
35
  STDERR.puts(e.to_s)
36
36
  keys_with_errors.push(key)
37
+ else
38
+ STDERR.puts("Ignoring 404 for ticket #{key}")
37
39
  end
38
40
  rescue => e
39
41
  STDERR.puts(e.to_s)
@@ -1,3 +1,3 @@
1
1
  module JiraSync
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jirasync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: