neo4j-java-driver 0.1.9-java → 0.1.10-java

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: c8f6243359fa432384043558192a60c5018ca7c4d180f0e94091eb0c7518a78b
4
- data.tar.gz: 1bcb87f252181393253aa6716ab2dcc6d8dda83fd142bf8ce1181f8972edb7ad
3
+ metadata.gz: cdce8678b1a26d06c9595b1224fd89326fc009a59df8cc866373e5ed03313af1
4
+ data.tar.gz: bd7ff576e5d906fcad58fa7e58e5e0eed56ee2189b7b490461778a680431b84f
5
5
  SHA512:
6
- metadata.gz: ba99069e780e9d8bedc6e6308c2df3af814930f01d7d1f392995c998e7708a91b172945a5fef2970b88d0d5f2462cfd907a50b5d1991f9aa6b053805dd2bad15
7
- data.tar.gz: e4d4edf8323802ddf15330ac0ef4c11e8b5110278128e85009d55dbacdeddfdab08d4f0aedf34c8565d614aa5cc02cc347bafbeff1f3091502f9ce6add2024ce
6
+ metadata.gz: f3adaf8eb2ca2045a589256374deeffeeeaf97bd27c8da02d9ad8aad15f9d5650ee53135abeabbb05a1ba47c9199b1c5224c2edbd717ea1a24e8a28548c1da4d
7
+ data.tar.gz: ee5feda0a5145540e451cab7bb8cf53804bc259825650c31cea19cea2efcd3716f2b1b1942f6f903be662e82f8d2c4dbc2370b478e4a9f75238dcc8394923107
@@ -17,6 +17,12 @@ module Neo4j
17
17
  rescue Java::JavaLang::IllegalArgumentException => e
18
18
  raise ArgumentError, e.message
19
19
  end
20
+
21
+ def reverse_check
22
+ yield
23
+ rescue StandardError => e
24
+ raise(e.cause || ExceptionMapper.reverse_exception_class(e)&.new('') || e)
25
+ end
20
26
  end
21
27
  end
22
28
  end
@@ -23,7 +23,14 @@ module Neo4j
23
23
  end
24
24
 
25
25
  def arguments
26
- [code, message, cause, suppressed.map(&method(:mapped_exception))]
26
+ [code, message, self, suppressed.map(&method(:mapped_exception))]
27
+ end
28
+
29
+ def self.reverse_exception_class(exception)
30
+ case exception
31
+ when Neo4j::Driver::Exceptions::ServiceUnavailableException
32
+ ServiceUnavailableException
33
+ end
27
34
  end
28
35
 
29
36
  private
@@ -9,7 +9,7 @@ module Neo4j
9
9
 
10
10
  auto_closable :driver
11
11
 
12
- def driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, config = {})
12
+ def driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, config = nil)
13
13
  check do
14
14
  java_method(:driver, [java.lang.String, org.neo4j.driver.v1.AuthToken, org.neo4j.driver.v1.Config])
15
15
  .call(uri.to_s, auth_token, to_java_config(config))
@@ -14,7 +14,7 @@ module Neo4j
14
14
 
15
15
  %i[read write].each do |prefix|
16
16
  define_method("#{prefix}_transaction") do |&block|
17
- check { super { |tx| Struct::Wrapper.new(block.call(tx)) }.object }
17
+ check { super { |tx| Struct::Wrapper.new(reverse_check { block.call(tx) }) }.object }
18
18
  end
19
19
  end
20
20
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '0.1.9'
5
+ VERSION = '0.1.10'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-java-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: java
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-28 00:00:00.000000000 Z
11
+ date: 2019-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement