globus_client 0.12.0 → 0.12.1

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: bb50d72f725c17c845856c0f00f8753c1c709ee1adbe9876a2863692692f7274
4
- data.tar.gz: 7c2b9379dcf066d3f827b10ecc8eb52106054bd1f5203e16015d8e21435fe9cd
3
+ metadata.gz: 65d27626412e2eff8ff6514be3ece81fd5f27e471137fcfd8409e51cd6e0f105
4
+ data.tar.gz: 321b1d89734daacb8ad54487836a68f1fdf1af931fad426d72ec35bc2f355ec8
5
5
  SHA512:
6
- metadata.gz: d2e10ae21d5e6d4c1cf2a42e69ee2e8608772812136e8f068e13418b6ddb606de72ef3e8e22c8a774baedbf986f16ccf0e1499cc1bf6f563866636d9a3c3c48e
7
- data.tar.gz: 8a0b323fa8002d1591f1b4ddb57e400862647d782faeb78da92e548fcdb5ef1acf064b499683db0c9609f50d9afcf06a4d41d99f1d4c36f0e3829ccdfc8f151a
6
+ metadata.gz: a4ce82aac85e8c00df5310cdb3b4f821cd1415ee0d525938562b20d97c86f330707691a8ee69dcbfeee53d0e20064f78fd902678d5aa4a0113cc7ce38f209c9a
7
+ data.tar.gz: 75888830f1b0660f78d551eb3fd2a323f40fb21e5ac9a361c0f8ea22be0b32a11a014dd42719e4b25c33f5f497e2d1b6b296c8db15f5dc89abaed5d4f03ff5e1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- globus_client (0.12.0)
4
+ globus_client (0.12.1)
5
5
  activesupport (>= 4.2, < 8)
6
6
  faraday
7
7
  faraday-retry
@@ -199,7 +199,8 @@ class GlobusClient
199
199
 
200
200
  # debugging of Globus responses
201
201
  response_body = JSON.parse(response.body)
202
- raise(StandardError, "Response is missing DATA in: #{response_body}") unless response_body.key?("DATA")
202
+
203
+ UnexpectedResponse.call(response, message: "Response is missing DATA in: #{response_body}") unless response.success? && response_body.key?("DATA")
203
204
 
204
205
  JSON
205
206
  .parse(response.body)["DATA"]
@@ -26,7 +26,7 @@ class GlobusClient
26
26
  # https://docs.globus.org/api/transfer/file_operations/#errors
27
27
  # https://docs.globus.org/api/transfer/acl/#common_errors
28
28
  # https://docs.globus.org/api/auth/reference/
29
- def self.call(response)
29
+ def self.call(response, message: "")
30
30
  case response.status
31
31
  when 400
32
32
  raise BadRequestError, "Invalid path or another error with the request: #{response.body}"
@@ -37,11 +37,11 @@ class GlobusClient
37
37
  when 404
38
38
  raise ResourceNotFound, "Endpoint ID not found or resource does not exist: #{response.body}"
39
39
  when 502
40
- raise EndpointError, "Other error with endpoint: #{response.body}"
40
+ raise EndpointError, "Other error with endpoint: #{response.status} #{response.body}. #{message}"
41
41
  when 503
42
42
  raise ServiceUnavailable, "The service is down for maintenance."
43
43
  else
44
- raise StandardError, "Unexpected response: #{response.status} #{response.body}"
44
+ raise StandardError, "Unexpected response: #{response.status} #{response.body}. #{message}"
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GlobusClient
4
- VERSION = "0.12.0"
4
+ VERSION = "0.12.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globus_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.4.19
211
+ rubygems_version: 3.4.13
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Interface for interacting with the Globus API.