improved_jenkins_client 1.6.5 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/improved_jenkins_client/client.rb +14 -7
- data/lib/improved_jenkins_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f381907a06146eab9fc814b98a7233a8981a570e2f5f812936f22d5d745844f5
|
4
|
+
data.tar.gz: 8f2011c9223b397e8d3045d259f715f3e346fa4bad1f24d778cb743699781a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9df1bcd1a5b4e9db2ac14074f20d36082d60ce9f7f3132b896df69ca79a8fce2fe3649d0bcc62284480c754ad9db72135fb88523b29f5be1678b43eb14a4527
|
7
|
+
data.tar.gz: 647de6de4983fc9138dcbe815f37d2c8f7dcc0cfa879d16edf3ee6c0f1296d4dbf0621a9d75b18693674e7571fe238ee170f40ba3074813479ec2cf6decc30bd
|
@@ -808,12 +808,19 @@ module JenkinsApi
|
|
808
808
|
# Jenkins that are not categorized in the API Client.
|
809
809
|
#
|
810
810
|
def handle_exception(response, to_send = "code", send_json = false, full_url: nil)
|
811
|
-
msg = "HTTP Code: #{response.code}
|
812
|
-
|
813
|
-
|
811
|
+
msg = "HTTP Code: #{response.code} "
|
812
|
+
|
813
|
+
msg += ", URL: #{full_url}" unless full_url.nil?
|
814
|
+
|
815
|
+
if @logger.level <= Logger::DEBUG
|
816
|
+
@logger.debug "#{msg}; Response Body: #{response.body}"
|
814
817
|
end
|
815
|
-
|
816
|
-
|
818
|
+
response_code = response.code.to_i
|
819
|
+
if response_code >= 400
|
820
|
+
@logger.warn msg
|
821
|
+
end
|
822
|
+
|
823
|
+
case response_code
|
817
824
|
# As of Jenkins version 1.519, the job builds return a 201 status code
|
818
825
|
# with a Location HTTP header with the pointing the URL of the item in
|
819
826
|
# the queue.
|
@@ -830,7 +837,7 @@ module JenkinsApi
|
|
830
837
|
when 400
|
831
838
|
matched = response.body.match(/<p>(.*)<\/p>/)
|
832
839
|
api_message = matched[1] unless matched.nil?
|
833
|
-
@logger.
|
840
|
+
@logger.warn "API message: #{api_message}"
|
834
841
|
case api_message
|
835
842
|
when /A job already exists with the name/
|
836
843
|
raise Exceptions::JobAlreadyExists.new(@logger, api_message)
|
@@ -852,7 +859,7 @@ module JenkinsApi
|
|
852
859
|
when 500
|
853
860
|
matched = response.body.match(/Exception: (.*)<br>/)
|
854
861
|
api_message = matched[1] unless matched.nil?
|
855
|
-
@logger.
|
862
|
+
@logger.warn "API message: #{api_message}"
|
856
863
|
raise Exceptions::InternalServerError.new(@logger, api_message)
|
857
864
|
when 503
|
858
865
|
raise Exceptions::ServiceUnavailable.new @logger
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: improved_jenkins_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kannan Manickam (the original jenkins_api_client gem)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-10-
|
12
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|