solrb 0.2.3 → 0.2.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
  SHA256:
3
- metadata.gz: e9ae1ed7f5931da9955de331a59ca5c10598882b38e137136464a136c9b9b079
4
- data.tar.gz: 91b33fad87d4bc4b286d591a0b2c91d1c51a63e59e9a53f9cc8e8891592fba87
3
+ metadata.gz: 10509ebef416e503416eb56c1467f5f76e431ac65cfae2aad5146a0be16a5ad8
4
+ data.tar.gz: 55521fb090044b3e4272b55c5f98200812e383eddcaa588ef88e3db098866bee
5
5
  SHA512:
6
- metadata.gz: 1539610c599f2493f8b3d6f0fd0c9b926b69032a2bffc0b0519aaf73c0e5175d63196657893452ce11b147a45243e648c683983049e0f685503be21ec6d60506
7
- data.tar.gz: 8d059163628f2c9220a467d6cada61e7b26cb088cc2db82d6b02f14836875f6089e5eb001de0d9dea8f3a74f92eb498bd26ac84a54e85901b7feefadc17b7b62
6
+ metadata.gz: a3c76b9a0f9f24798a57ce5c29d8f24c67310a3ae35e4dcf3b0cee0751c2da1e34cc639b9ce286ecbad67960f786c45d52a16e6831b79e2375d7275ee6f9667a
7
+ data.tar.gz: ff97ef55cd9dac6c77c0ebd0ca41b9accff470667148972c974cd5d4a3456a112ae20069d9d8e81f4524fd73565c18baa44d32bcd76d50c93c65131ea5d90ad9
@@ -1,10 +1,11 @@
1
1
  module Solr
2
2
  module Errors
3
3
  class SolrConnectionFailedError < StandardError
4
- def initialize(solr_urls)
4
+ def initialize(solr_url_errors)
5
+ urls_message = solr_url_errors.map { |url, error| "[#{url}] #{error}" }.join("\n")
5
6
  message = <<~MESSAGE
6
7
  Could not connect to any available solr instance:
7
- #{solr_urls.join(', ')}
8
+ #{urls_message}
8
9
  MESSAGE
9
10
  super(message)
10
11
  end
@@ -28,6 +28,7 @@ module Solr
28
28
  end
29
29
 
30
30
  def call
31
+ solr_url_errors = {}
31
32
  solr_urls.each do |node_url|
32
33
  request_url = build_request_url(url: node_url,
33
34
  path: request.path,
@@ -38,11 +39,12 @@ module Solr
38
39
  raise Solr::Errors::SolrQueryError, solr_response.error_message unless solr_response.ok?
39
40
  return solr_response
40
41
  rescue Faraday::ConnectionFailed, Faraday::TimeoutError, Errno::EADDRNOTAVAIL => e
42
+ solr_url_errors[node_url] = "#{e.class.name} - #{e.message}"
41
43
  # Try next node
42
44
  end
43
45
  end
44
46
 
45
- raise Solr::Errors::SolrConnectionFailedError.new(solr_urls)
47
+ raise Solr::Errors::SolrConnectionFailedError.new(solr_url_errors)
46
48
  end
47
49
 
48
50
  private
data/lib/solr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solr
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Luz
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-04-04 00:00:00.000000000 Z
13
+ date: 2019-04-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable