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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5e3ab978aae76e66bdf9720e0b0138ae3be35c51ee8406d6771bfa06e726df9
4
- data.tar.gz: b51554cee84fc6bf7ed9875ea1b0be779d154af92da9a2468c00313f06d799f2
3
+ metadata.gz: 812fe26d9912691db44a47c640f42fade096a9fcfe3e7ce18a78fac4ad9c26b4
4
+ data.tar.gz: a99feaa9cb13c5db7e9b7cb8740e2862798c18f0d1279b2604be1293c27929cb
5
5
  SHA512:
6
- metadata.gz: ac0df4ec63782ae8409e3d094bf747035a5721ab2d8074d754fd6e053f0f8478159e56bf1cd66e6e22ca95a92f4969cd136e520f7cf6335a0e32929188c5af8e
7
- data.tar.gz: 21f7223520a6eb116ea50400b9f788c20a52ff2c173aac9088b1a9dbbb34a99998498e2f2a1795dac380876b77f76ac59a1c9ec103d7335909bfe03298613370
6
+ metadata.gz: 1243c6319f2bfdbc2ccfc367026e8dfd83d84dcdc4b4206d8d5fc25aff98e310843c01806b0bca46b41fa4d3c89ba1cf89d49372a5ea514fa9f75326dfb3a2ba
7
+ data.tar.gz: c6d3eadac2836ba6c416c098f228799bffe7cab955c39f49c5507115af9e6a67c440d78ac5885a1da091ffa42c46d608cf9b5098b579d86f05658402d4265bd3
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Almodovar
2
- VERSION = '1.7.8'
2
+ VERSION = '1.8.0'
3
3
  end
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.7.8
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: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder