fbaa_api 0.9.1 → 0.9.2
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/fbaa_api/client.rb +12 -2
- data/lib/fbaa_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6445cdc905b368eb8b01995add5d33ffb30420f9
|
4
|
+
data.tar.gz: be097fd0cc5de7c6b2066959a6e192f960a0826a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f40daf8536f8b11ca3c104d35d6dfe234eb9ad20aeee871d40d4bdec828fa974af41fe986a198621d2514cf21d38f88892cd2c1bd3cef36cc8fb659aa423c8d2
|
7
|
+
data.tar.gz: f9724ad453a5d05553d7c875a4dbe5acfbec3a32bf1de2e57a94d3fc6491b10d7c3b1dd683b42e351160bff10d1e518089c18e15f1c1a8d2f75391db4c70275f
|
data/lib/fbaa_api/client.rb
CHANGED
@@ -37,6 +37,7 @@ module FbaaApi
|
|
37
37
|
|
38
38
|
def request(method, path, params = {})
|
39
39
|
url = "#{fbaa_url}/#{path}"
|
40
|
+
config.logger.info("Fbaa::Client - #request url = #{url}")
|
40
41
|
req = RestClient::Request.new(
|
41
42
|
url: url,
|
42
43
|
headers: { params: params }.merge(headers),
|
@@ -44,13 +45,15 @@ module FbaaApi
|
|
44
45
|
)
|
45
46
|
response = signed_request(req).execute
|
46
47
|
|
47
|
-
config.logger.info("Fbaa::Client -
|
48
|
+
config.logger.info("Fbaa::Client - response code #{response.code}")
|
48
49
|
config.logger.info("Fbaa::Client - body #{response.body}")
|
49
50
|
|
50
51
|
{ status: response.code, body: JSON.parse(response.body) }
|
51
|
-
rescue JSON::ParserError
|
52
|
+
rescue JSON::ParserError => e
|
53
|
+
log_exception(e)
|
52
54
|
{ status: 500, body: { 'error_messages' => "JSON::ParseError #{response.body}" } }
|
53
55
|
rescue => e
|
56
|
+
log_exception(e)
|
54
57
|
if e.respond_to?(:response)
|
55
58
|
response = e.response
|
56
59
|
{ status: response.code, body: JSON.parse(response.body) }
|
@@ -74,6 +77,13 @@ module FbaaApi
|
|
74
77
|
def config
|
75
78
|
FbaaApi.configuration
|
76
79
|
end
|
80
|
+
|
81
|
+
def log_exception(e)
|
82
|
+
config.logger.error e.class.to_s
|
83
|
+
config.logger.error e.message
|
84
|
+
config.logger.error e.backtrace.join("\n")
|
85
|
+
end
|
86
|
+
|
77
87
|
end
|
78
88
|
end
|
79
89
|
|
data/lib/fbaa_api/version.rb
CHANGED