afterpay 0.3.0 → 0.4.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: 9c0546dacab8904577cf4598e6d6df51252708a23c2a1aaff7d60c1f89ae9fe4
4
- data.tar.gz: d669f542377a1f1690375dc1721183eb96cc1fa911ccdb7534ca1f71ec416a01
3
+ metadata.gz: 6c829dfe7fe6c2d66b576afc39133de1e5aff0827927776f34250559d6f5c81d
4
+ data.tar.gz: eb89d0cda49ff77dce1b0832437109fac6455c0536ee6b6efdc6a47f11e1209a
5
5
  SHA512:
6
- metadata.gz: e6ba4ea7c953533d03ffd0850d672be93076614d6b85c9d73beefe78a61688ce2bdedf064e300daad9d44126162090dbe69c86fd95e7fb5f473dab522d78a3e3
7
- data.tar.gz: 9987f7c53e07053a090c221b68a4329c58944d0a0fc135b1b4012ad6a12593395a1d7326f9cd35e14e66a0b2cc45e8d9f257264122cbf86bf88a9cf65bcfa3cb
6
+ metadata.gz: fa3d155dcd5b4003a0cb964629b32ac3022227e70b654d3dad4b7c2b04f6f22f43812bb6822e3940da04c9844e3bd89c8a6d790ccb027783dedf81be76879aca
7
+ data.tar.gz: ada7635705fa5cf6fbc275566a573e417ecf8506db74547280ca44c61b2d3970428614bacc34d04664579a4afe4c5de67268c4287c1ffcfde11b677f2c427215
@@ -11,6 +11,8 @@ module Afterpay
11
11
  class Base < Callable
12
12
  def call
13
13
  ::Afterpay::ErrorHandler.inspect(response)
14
+ rescue ::Faraday::TimeoutError => e
15
+ raise RequestTimeoutError.new(e.response_status), e.message
14
16
  end
15
17
 
16
18
  private
@@ -29,13 +29,15 @@ module Afterpay
29
29
  404 => NotFoundError,
30
30
  405 => MethodNotAllowedError,
31
31
  406 => NotAcceptableError,
32
+ 408 => RequestTimeoutError,
32
33
  409 => ConflictError,
33
34
  410 => GoneError,
34
35
  412 => PreconditionFailedError,
35
36
  422 => UnprocessableEntityError,
36
37
  429 => TooManyRequestsError,
37
38
  500 => InternalServerError,
38
- 503 => ServiceUnavailableError
39
+ 503 => ServiceUnavailableError,
40
+ 504 => GatewayTimeoutError
39
41
  }.freeze
40
42
  end
41
43
  end
@@ -22,6 +22,8 @@ module Afterpay
22
22
 
23
23
  class NotAcceptableError < BaseError; end
24
24
 
25
+ class RequestTimeoutError < BaseError; end
26
+
25
27
  class ConflictError < BaseError; end
26
28
 
27
29
  class GoneError < BaseError; end
@@ -35,4 +37,6 @@ module Afterpay
35
37
  class InternalServerError < BaseError; end
36
38
 
37
39
  class ServiceUnavailableError < BaseError; end
40
+
41
+ class GatewayTimeoutError < BaseError; end
38
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Afterpay
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afterpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Vygovsky
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-10-01 00:00:00.000000000 Z
14
+ date: 2021-10-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday