ncore 2.0.3 → 2.0.4

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
  SHA1:
3
- metadata.gz: 4441c9e7ba667633a196a781361ce85e8b07934c
4
- data.tar.gz: e4d0467cf4e209603ce1abfc0392e8b021f5cd95
3
+ metadata.gz: bb74f645a9005a54e5a3bedaa7fdfbd8b5b51a84
4
+ data.tar.gz: dcd43c51806ca15fa68f0ba3baad9c3973a2fc0e
5
5
  SHA512:
6
- metadata.gz: 0068a362c54031b269344f918ea54584dc15e17ea6674197c9e987a77c8866f1cb8c83325c136af730285594ee8f801b038c8a0e7ef6ddb71e6e4fc9de008482
7
- data.tar.gz: 9a46b176fb7585a1afbcbfbac62faf7d96beaf46e8a2e4eaa9a68312d9725448d9eddffa0d030260d0c7582b36cfed1c4545a9404c6524fc007dffa44a5f9220
6
+ metadata.gz: a2c0db6acc9977609011051a1bb7afd2f4da11155e02dde9b0e49fb339ecd27920997df2d692c7b9c88235f5a05b5d23b9c96200579bdefeca58a709b55704d1
7
+ data.tar.gz: 8b812f822dde0db851bcdf2b67422a3c86929442c8a0e2619d8d62e69c2617487b72a54de0c61dfb91608cbcae0db21c49d2f7a4d09ac19000e6af3192b2098d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ #### 2.0.4
2
+ - Better handle network error
3
+
1
4
  #### 2.0.3
2
5
  - Fix incorrect dependency on MultiJson
3
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2016 Notioneer, Inc.
1
+ Copyright (c) 2014-2017 Notioneer, Inc.
2
2
 
3
3
  MIT License
4
4
 
data/lib/ncore/client.rb CHANGED
@@ -175,7 +175,7 @@ module NCore
175
175
  begin
176
176
  tries += 1
177
177
  response = connection.request rest_opts.except(:url)
178
- rescue Excon::Errors::SocketError, Errno::EADDRNOTAVAIL => e
178
+ rescue Excon::Errors::SocketError, Excon::Error::Timeout, Errno::EADDRNOTAVAIL => e
179
179
  # retry when keepalive was closed
180
180
  if tries <= 1 #&& e.message =~ /end of file reached/
181
181
  retry
@@ -190,6 +190,13 @@ module NCore
190
190
  raise parent::ConnectionError, "Connection reset for #{host_for_error rest_opts[:url]} : check network or visit #{status_page}."
191
191
  rescue Errno::ECONNREFUSED
192
192
  raise parent::ConnectionError, "Connection error for #{host_for_error rest_opts[:url]} : check network and DNS or visit #{status_page}."
193
+ rescue Excon::Error::Timeout => e
194
+ case e.message
195
+ when /timeout reached/
196
+ raise parent::ConnectionError, "Connection error for #{host_for_error rest_opts[:url]} : check network and DNS or visit #{status_page}."
197
+ else
198
+ raise e
199
+ end
193
200
  rescue Excon::Errors::SocketError => e
194
201
  case e.message
195
202
  when /Unable to verify certificate/
data/lib/ncore/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '2.0.3'
2
+ VERSION = '2.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport