vagrant_cloud 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant_cloud/client.rb +9 -1
- data/lib/vagrant_cloud/error.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d18cd817a0a9b3c10c3e1b16a0e7738ed92ea93b8b94e660fa3bfc4a1d66d14f
|
4
|
+
data.tar.gz: ad5d13564800b261a3144ab156d54de6c051623b57980416fa22522fa0bc0dec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55b01997babffc39900b35462c455df7d9bae1a6e9c3cf192b15f5d6d8de2b394ab82fee02a3e16ebfc163dc45930b36d26b2ca2d45ecea6ca74af9026863481
|
7
|
+
data.tar.gz: 154a11bbd5d86adde19251aa8da1e3da4441803a4c1fd2a59f5a86193218f3cefb676c4d3d7320c8d01608260388874a321993a0eb34e38ca137682c1ab2c06e
|
data/lib/vagrant_cloud/client.rb
CHANGED
@@ -126,7 +126,15 @@ module VagrantCloud
|
|
126
126
|
# Set a request ID so we can track request/responses
|
127
127
|
request_params[:headers] = {"X-Request-Id" => SecureRandom.uuid}
|
128
128
|
|
129
|
-
|
129
|
+
begin
|
130
|
+
result = with_connection { |c| c.request(request_params) }
|
131
|
+
rescue Excon::Error::HTTPStatus => err
|
132
|
+
raise Error::ClientError::RequestError.new(
|
133
|
+
"Vagrant Cloud request failed", err.response.body, err.response.status)
|
134
|
+
rescue Excon::Error => err
|
135
|
+
raise Error::ClientError, err.message
|
136
|
+
end
|
137
|
+
|
130
138
|
parse_json(result.body)
|
131
139
|
end
|
132
140
|
|
data/lib/vagrant_cloud/error.rb
CHANGED
@@ -2,8 +2,8 @@ module VagrantCloud
|
|
2
2
|
class Error < StandardError
|
3
3
|
class ClientError < Error
|
4
4
|
class RequestError < ClientError
|
5
|
-
attr_accessor :error_arr
|
6
5
|
attr_accessor :error_code
|
6
|
+
attr_accessor :error_arr
|
7
7
|
|
8
8
|
def initialize(msg, http_body, http_code)
|
9
9
|
message = msg
|
@@ -22,7 +22,7 @@ module VagrantCloud
|
|
22
22
|
vagrant_cloud_msg = err.message
|
23
23
|
end
|
24
24
|
|
25
|
-
@error_arr = vagrant_cloud_msg
|
25
|
+
@error_arr = Array(vagrant_cloud_msg)
|
26
26
|
@error_code = http_code.to_i
|
27
27
|
super(message)
|
28
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HashiCorp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-10-
|
12
|
+
date: 2020-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
|
-
rubygems_version: 3.1.
|
131
|
+
rubygems_version: 3.1.4
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Vagrant Cloud API Library
|