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 +4 -4
- data/lib/solr/errors/solr_connection_failed_error.rb +3 -2
- data/lib/solr/request/runner.rb +3 -1
- data/lib/solr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10509ebef416e503416eb56c1467f5f76e431ac65cfae2aad5146a0be16a5ad8
|
4
|
+
data.tar.gz: 55521fb090044b3e4272b55c5f98200812e383eddcaa588ef88e3db098866bee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
-
#{
|
8
|
+
#{urls_message}
|
8
9
|
MESSAGE
|
9
10
|
super(message)
|
10
11
|
end
|
data/lib/solr/request/runner.rb
CHANGED
@@ -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(
|
47
|
+
raise Solr::Errors::SolrConnectionFailedError.new(solr_url_errors)
|
46
48
|
end
|
47
49
|
|
48
50
|
private
|
data/lib/solr/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2019-04-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|