tribune_recurly_api 1.0.2 → 1.0.3
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 +4 -4
- data/lib/recurly_api/client.rb +7 -0
- data/lib/recurly_api/exception_handler.rb +5 -5
- data/lib/recurly_api/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af64dadcbbd3277c1b4a5456251bb92c3559c9bcb7ce8e58d397964194d61011
|
4
|
+
data.tar.gz: f4ceb3fad5a513a2ca8e944cd1e536689918662be57f7610825e6b86211d832c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a43e99ab5c9522148328ee1a61f7a56122efe293c41f8548feffea4ce8437c0b1873a86e2920c3a72d9b00abd9d385b60d27234965dcfbacf87a45b58444f6e
|
7
|
+
data.tar.gz: 5a1a9f1b0d040f1901eb44a381236e08215e41ac56614b03da42d0ec93ef51ec7e77c78be7aed98cc39b88eefd4be73acb5d6352e5514a657efc98b348a80b2c
|
data/lib/recurly_api/client.rb
CHANGED
@@ -184,5 +184,12 @@ module RecurlyApi
|
|
184
184
|
error: json_body['error']['type'],
|
185
185
|
message: json_body['error']['message'] }
|
186
186
|
end
|
187
|
+
|
188
|
+
def handle_recurly_error_response(resp)
|
189
|
+
json_body = JSON.parse(resp.body)
|
190
|
+
return unless json_body['error']
|
191
|
+
|
192
|
+
handle_error_response(resp.code, json_body)
|
193
|
+
end
|
187
194
|
end
|
188
195
|
end
|
@@ -10,21 +10,21 @@ module RecurlyApi
|
|
10
10
|
rescue RestClient::Unauthorized, RestClient::Forbidden => e
|
11
11
|
# https://www.rubydoc.info/gems/rest-client/1.6.7/frames#label-Result+handling
|
12
12
|
logger.error("#{logger_heading} ERROR: Access denied to Recurly API")
|
13
|
-
|
13
|
+
handle_recurly_error_response(e.response)
|
14
14
|
rescue RestClient::ImATeapot => e
|
15
15
|
logger.error("#{logger_heading} ERROR: Recurly Server is a teapot! # RFC 2324")
|
16
|
-
|
16
|
+
handle_recurly_error_response(e.response)
|
17
17
|
rescue RestClient::MovedPermanently,
|
18
18
|
RestClient::Found,
|
19
19
|
RestClient::TemporaryRedirect => e
|
20
20
|
logger.error("#{logger_heading} ERROR: Follow redirection- #{e.response.follow_redirection}")
|
21
|
-
|
21
|
+
handle_recurly_error_response(e.response)
|
22
22
|
rescue RestClient::ExceptionWithResponse => e
|
23
23
|
logger.error("#{logger_heading} ERROR: RestClient::ExceptionWithResponse")
|
24
|
-
|
24
|
+
handle_recurly_error_response(e.response)
|
25
25
|
rescue RestClient::Exception => e
|
26
26
|
logger.error("#{logger_heading} ERROR: RestClient::Exception")
|
27
|
-
|
27
|
+
handle_recurly_error_response(e.response)
|
28
28
|
# rescue StandardError => e # Note: don't rescue standard error
|
29
29
|
# logger.error("#{logger_heading} ERROR: Internal Server Error")
|
30
30
|
# # e.backtrace.join("\n ")
|
data/lib/recurly_api/version.rb
CHANGED
@@ -15,5 +15,6 @@ module RecurlyApi
|
|
15
15
|
# STRING
|
16
16
|
# end
|
17
17
|
# VERSION = '1.0.1' # cache settings from configuration file
|
18
|
-
VERSION = '1.0.2' # prefixing '<code->' to ssor_id is now part of GEM
|
18
|
+
# VERSION = '1.0.2' # prefixing '<code->' to ssor_id is now part of GEM
|
19
|
+
VERSION = '1.0.3' # return recurly error response
|
19
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tribune_recurly_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- udevulapally
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|