almodovar 1.7.8 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/almodovar/errors.rb +10 -2
- data/lib/almodovar/version.rb +1 -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: 812fe26d9912691db44a47c640f42fade096a9fcfe3e7ce18a78fac4ad9c26b4
|
4
|
+
data.tar.gz: a99feaa9cb13c5db7e9b7cb8740e2862798c18f0d1279b2604be1293c27929cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1243c6319f2bfdbc2ccfc367026e8dfd83d84dcdc4b4206d8d5fc25aff98e310843c01806b0bca46b41fa4d3c89ba1cf89d49372a5ea514fa9f75326dfb3a2ba
|
7
|
+
data.tar.gz: c6d3eadac2836ba6c416c098f228799bffe7cab955c39f49c5507115af9e6a67c440d78ac5885a1da091ffa42c46d608cf9b5098b579d86f05658402d4265bd3
|
data/lib/almodovar/errors.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
module Almodovar
|
2
2
|
class HttpError < StandardError
|
3
|
-
attr_reader :response_status, :response_body
|
3
|
+
attr_reader :response_status, :response_body, :response_headers
|
4
4
|
|
5
5
|
# Children of this class must not override the initialize method
|
6
6
|
def initialize(response, url, query_params = {})
|
7
7
|
@response_status = response.status
|
8
8
|
@response_body = response.body
|
9
|
+
@response_headers = response.headers
|
9
10
|
message = "Status code #{response.status} on resource #{url}"
|
10
11
|
message += " with params: #{query_params.inspect}" if query_params.present?
|
11
12
|
super(message)
|
@@ -62,7 +63,14 @@ module Almodovar
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
66
|
+
class TooManyRequestsError < HttpError
|
67
|
+
def ratelimit_reset
|
68
|
+
@ratelimit_reset ||= response_headers["ratelimit-reset"]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
65
72
|
HTTP_ERRORS = {
|
66
|
-
422 => UnprocessableEntityError
|
73
|
+
422 => UnprocessableEntityError,
|
74
|
+
429 => TooManyRequestsError
|
67
75
|
}
|
68
76
|
end
|
data/lib/almodovar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: almodovar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BeBanjo S.L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|