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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00b96df31d811857d6e1322587604bc91195401913872e3340fa89eb8c0816fd
4
- data.tar.gz: 52da865c61e7d50b5777a2a9ea2cc3bd6d7c22c1a3e2a34bc2bfdd537515b0da
3
+ metadata.gz: d18cd817a0a9b3c10c3e1b16a0e7738ed92ea93b8b94e660fa3bfc4a1d66d14f
4
+ data.tar.gz: ad5d13564800b261a3144ab156d54de6c051623b57980416fa22522fa0bc0dec
5
5
  SHA512:
6
- metadata.gz: 9e6a2b72a501bc694992e9de0b789cba4c38fb8c6f176cd4c2e5ca4bd0fb387db5d2b23ada2307b7c63d6590b4ad3b1a8c8f98c74fbcd4f95ffd9c49cb028604
7
- data.tar.gz: a0e90c8f8adad13d0dccd154cf50407065048a8e773df01c50482bdf79787d744e91d5b2e1a6f431c20c7d37656d894aa82c3fdf3e4f7501da5882bd029dff42
6
+ metadata.gz: 55b01997babffc39900b35462c455df7d9bae1a6e9c3cf192b15f5d6d8de2b394ab82fee02a3e16ebfc163dc45930b36d26b2ca2d45ecea6ca74af9026863481
7
+ data.tar.gz: 154a11bbd5d86adde19251aa8da1e3da4441803a4c1fd2a59f5a86193218f3cefb676c4d3d7320c8d01608260388874a321993a0eb34e38ca137682c1ab2c06e
@@ -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
- result = with_connection { |c| c.request(request_params) }
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
 
@@ -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.1
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-27 00:00:00.000000000 Z
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.2
131
+ rubygems_version: 3.1.4
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Vagrant Cloud API Library