bbk-http 0.1.0.200749 → 0.1.0.200750

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: 32372564a3ac04487b46c79e9d146c24a874ef439a7dbc6474035186ed79b18e
4
- data.tar.gz: f84a2f6707aa5da7da25d0f9a5743995b63f2172d15268f9d7329d5071a6d842
3
+ metadata.gz: 2b829ac8739e29a0fcd3e9e312df2637716cec56f023ff45784148ba3b889f36
4
+ data.tar.gz: fa6cb4d1060d584836d1af4dd5078910a5fa641896d4d176957b621cfe46c919
5
5
  SHA512:
6
- metadata.gz: 9adeae96516df072a551084a61fb5e5d1e90d733a16bd909a6e3e3392005099158f1affd382f03bc297de956a8f759db5685debee6b15b58dd21af4aa50cba58
7
- data.tar.gz: 818b0c33d8086784618a8389444b5f897a9021bd39e8660c84d403f9ec47631123157a181a90575e7dc26a0c498930aeb6fa0ef7709a65e1f09185ccc9a4230d
6
+ metadata.gz: 0b7b0083da74e9dc05b3ffebe184be842a67e7a528b35a6b5b1d3948695f19a8d945f389bd8e0f3b4dfe891492f94e5c713acc1875697e285129d264bb898462
7
+ data.tar.gz: 05f94c91352f7c2ef86756c845f91401239f66c9b96df3d07fcba72c4cf00e459552c2d5b7fc3cee86d5ebeffe768875524d027bc23b70e82e1e81777e712299
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bbk-http (0.1.0.200749)
4
+ bbk-http (0.1.0.200750)
5
5
  activesupport (>= 6.0)
6
6
  bbk-utils (> 1.0.1)
7
7
  faraday (~> 2.7.12)
@@ -13,7 +13,8 @@ module BBK
13
13
  Oj::Rails.mimic_JSON
14
14
 
15
15
  class PublishError < StandardError
16
-
16
+
17
+
17
18
  DEFAULT_MESSAGE = 'HTTP publishing error'.freeze
18
19
 
19
20
  attr_reader :context
@@ -72,7 +73,9 @@ module BBK
72
73
  headers[CONTENT_TYPE_HEADER] = content_type
73
74
  options = @default_connection_options.merge(options)
74
75
  logger.debug("Connection options: #{options}") if options.present?
75
- response = Faraday.new(uri, **options.slice(Faraday::ConnectionOptions.members)).send(method.to_sym, '', payload, headers)
76
+ response = Faraday.new(uri, **options.slice(Faraday::ConnectionOptions.members)).send(
77
+ method.to_sym, '', payload, headers
78
+ )
76
79
  Concurrent::Promises.resolvable_future.tap do |f|
77
80
  data = response.to_hash
78
81
  if response.success?
@@ -84,7 +87,10 @@ module BBK
84
87
  end
85
88
  rescue Faraday::ConnectionFailed => e
86
89
  logger.error "Faraday connection failed error: #{e.inspect}"
87
- Concurrent::Promises.resolvable_future.reject(PublishError.new({cause: e}))
90
+ Concurrent::Promises.resolvable_future.reject(PublishError.new({ cause: e }))
91
+ rescue Faraday::Error => e
92
+ logger.error "Faraday error: #{e.inspect}"
93
+ Concurrent::Promises.resolvable_future.reject(PublishError.new({ cause: e }))
88
94
  end
89
95
 
90
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbk-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.200749
4
+ version: 0.1.0.200750
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoylenko Yuri