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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d924687d191c069d05698fc954924efa40f1024ab280be5d7d13f434c20b680
4
- data.tar.gz: 760ca0221281fec74064f4f151927ff765dc2f0024c155ed0bdf154f02346f9a
3
+ metadata.gz: f381907a06146eab9fc814b98a7233a8981a570e2f5f812936f22d5d745844f5
4
+ data.tar.gz: 8f2011c9223b397e8d3045d259f715f3e346fa4bad1f24d778cb743699781a92
5
5
  SHA512:
6
- metadata.gz: 4f46f6c49204c1ac5562d2dad223eec0411e622404f0fe6db4824a792367809b1237b202db9d6951037d4271f4434adf8c90e13dcd0d742bf428c09fc4c70f6d
7
- data.tar.gz: c54d3c43bc7ddc242bf63081f4bde37e7b3e9700f73badbcac2681e2dbbd89e95d21eb5192b80a46aca1ad833d5bd1875c02dc6bfa12920bde4877c7b4d3d81e
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}, Response Body: #{response.body}"
812
- unless full_url.nil?
813
- msg += " URL: #{full_url}"
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
- @logger.debug msg
816
- case response.code.to_i
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.debug "API message: #{api_message}"
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.debug "API message: #{api_message}"
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
@@ -27,7 +27,7 @@ module JenkinsApi
27
27
  # Minor version of the gem
28
28
  MINOR = 6
29
29
  # Tiny version of the gem used for patches
30
- TINY = 5
30
+ TINY = 6
31
31
  # Used for pre-releases
32
32
  PRE = nil
33
33
  # Version String of Jenkins API Client.
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.5
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-22 00:00:00.000000000 Z
12
+ date: 2021-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri