nexus_api 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 593a1c9c8f0ae411f0dceb74937549defaa861aed877a911363535ef08c1666c
4
- data.tar.gz: 041e2a1f1acc3955688d56fc840a41c2b8f337499c0f7bfa751eff7fecd73ba5
3
+ metadata.gz: 1524dfad12c5d501e3d8d6c90a7cd712c8ded00a526093239c04aff862323546
4
+ data.tar.gz: a1c22bcdd81c450a79cbabf5adeab806eef96f2ae0b70fbe8401f5042f23e0d0
5
5
  SHA512:
6
- metadata.gz: 7e5b2a098e126a0e5d80819949ad50e78be80ef3ba69128e1a00e1cb15963baa69922acb811198f0abc11846a2a677dcbfd5eb471774424809afa64e51aa0b86
7
- data.tar.gz: bb214d0d407c604860e63eadd0bf489a7b61d6b9d1cadf3d639f8d0212d3ad53ae9e8f916b55efdfd5881b3140ba084656282fd4028dec13a40233f8f55c7633
6
+ metadata.gz: 52ee4482ce15c00b1eae0064c0445c6862cd4bc876e915335c923bc2f1f024bd0cb0cdee09ac41d917fe7d1abfe3a5f4dbcc717894e36e8e5a016eb54605b82e
7
+ data.tar.gz: ff03e64fdeb4e9c28ffcc94329ca79e2526411982ae36f40177dab99dbef6279810e5bebdfbae5fb50ec324f7f61fc64b6d8a3218b93e726ba44e44183fd3f5a
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
 
8
+ ## [1.4.1](https://github.com/Cisco-AMP/nexus_api/compare/v1.4.0...v1.4.1) - 2020-05-08
9
+ ### Changed
10
+ - Error reporting to be more descriptive
11
+
12
+
8
13
  ## [1.4.0](https://github.com/Cisco-AMP/nexus_api/compare/v1.3.0...v1.4.0) - 2020-05-05
9
14
  ### Added
10
15
  - Optional `tag` parameter to `associate_tag()` and `delete_associated_tag()` methods
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexus_api (1.4.0)
4
+ nexus_api (1.4.1)
5
5
  bundler (~> 2)
6
6
  docker-api (~> 1.34.2)
7
7
  dotenv (~> 2.7.5)
@@ -15,8 +15,8 @@ module NexusAPI
15
15
  return false unless docker_valid?
16
16
  image_name = image_name(@pull_host, image_name, tag)
17
17
  begin
18
- image = @docker.pull_image(@username, @password, image_name)
19
- rescue Docker::Error::NotFoundError => error
18
+ @docker.pull_image(@username, @password, image_name)
19
+ rescue Docker::Error::NotFoundError
20
20
  puts "ERROR: Failed to pull Docker image #{image_name}.\nDoes it exist in Nexus?"
21
21
  return false
22
22
  end
@@ -88,7 +88,11 @@ module NexusAPI
88
88
 
89
89
  def handle(error)
90
90
  puts "ERROR: Request failed"
91
- puts error.description if error.is_a?(RestClient::Response)
91
+ if error.is_a?(RestClient::Response)
92
+ puts error.description
93
+ else
94
+ puts error.to_s
95
+ end
92
96
  end
93
97
 
94
98
  def catch_connection_error
@@ -98,8 +102,12 @@ module NexusAPI
98
102
  return handle(error)
99
103
  rescue RestClient::Unauthorized => error
100
104
  return handle(error)
105
+ rescue RestClient::Exceptions::ReadTimeout => error
106
+ return handle(error)
101
107
  rescue RestClient::ExceptionWithResponse => error
102
108
  return handle(error.response)
109
+ rescue StandardError => error
110
+ return handle(error)
103
111
  end
104
112
  end
105
113
 
@@ -124,7 +132,7 @@ module NexusAPI
124
132
  # paginate answers is the user requesting pagination, paginate? answers does a continuation token exist
125
133
  # if an empty continuation token is included in the request we'll get an ArrayIndexOutOfBoundsException
126
134
  endpoint += "#{url_marker}continuationToken=#{@continuation_token}" if paginate && paginate?
127
- response = send_request(
135
+ send_request(
128
136
  :get,
129
137
  endpoint,
130
138
  headers: headers,
@@ -1,4 +1,4 @@
1
1
  module NexusAPI
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexus_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Levesque