http_utilities 1.3.7 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/http_utilities.gemspec +1 -1
- data/lib/http_utilities/http/client.rb +6 -2
- data/lib/http_utilities.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca7938604d4814cf219bf301c6dc09aa46eeb291dbd511ecfe1e06a4b5f24ed1
|
4
|
+
data.tar.gz: 96b644d0788ff62aff276785ebe7cd623c1a3f66b1e30c8bf20344d6c90e6853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89c13106c5399ae51fd31acafd83080786a903f4da5007434f6be1c7ba7e2ae87294806eb82b5a89068dec038733ceaab462563c8d61aadb50c7b17dd880ad85
|
7
|
+
data.tar.gz: 4f2499c3d882ca00a2ec31b077b4a5950eb40a1633809dce48494845b4213891b90ff0a1d238345c5a1d4b7470959bfea301277ce1851bb966f631be504e7847
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.8
|
data/http_utilities.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = "http_utilities"
|
6
|
-
s.version = "1.3.
|
6
|
+
s.version = "1.3.8"
|
7
7
|
|
8
8
|
s.authors = ["Sebastian Johnsson"]
|
9
9
|
s.description = "Wrapper for Faraday with additional functionality"
|
@@ -5,6 +5,10 @@ module HttpUtilities
|
|
5
5
|
class Client
|
6
6
|
include HttpUtilities::Http::Logger
|
7
7
|
|
8
|
+
EXCEPTIONS = [
|
9
|
+
Faraday::Error
|
10
|
+
]
|
11
|
+
|
8
12
|
def get(url, arguments: {}, options: {}, raise_exceptions: false, retries: 3)
|
9
13
|
response = nil
|
10
14
|
|
@@ -13,7 +17,7 @@ module HttpUtilities
|
|
13
17
|
response = request.interface.get(url, arguments)
|
14
18
|
response = HttpUtilities::Http::Response.new(response: response, request: request, options: options)
|
15
19
|
|
16
|
-
rescue
|
20
|
+
rescue *EXCEPTIONS => e
|
17
21
|
log(:error, "[HttpUtilities::Http::Client] - An error occurred while trying to fetch the response. Error Class: #{e.class.name}. Error Message: #{e.message}.")
|
18
22
|
retries -= 1
|
19
23
|
retry if retries > 0
|
@@ -31,7 +35,7 @@ module HttpUtilities
|
|
31
35
|
response = request.interface.post(url, data)
|
32
36
|
response = HttpUtilities::Http::Response.new(response: response, request: request, options: options)
|
33
37
|
|
34
|
-
rescue
|
38
|
+
rescue *EXCEPTIONS => e
|
35
39
|
log(:error, "[HttpUtilities::Http::Client] - An error occurred while trying to fetch the response. Error Class: #{e.class.name}. Error Message: #{e.message}.")
|
36
40
|
retries -= 1
|
37
41
|
retry if retries > 0
|
data/lib/http_utilities.rb
CHANGED