jrpc 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jrpc.rb +1 -0
- data/lib/jrpc/error/connection_error.rb +11 -0
- data/lib/jrpc/tcp_client.rb +6 -0
- data/lib/jrpc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d50ab0067ae7afd904f28ddbbea101007a5d0b8
|
4
|
+
data.tar.gz: 05b0c1cacb643a91d2f678aa8f0f8b56171b7a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d360a93e53d3ae19d31a16297d75a3cb6f35d08fbff9eca0117fa7e426fc426498dc7ae94abbcc5acc18ca99f1e8917ae9353810e6ceb868a697c43a2929827
|
7
|
+
data.tar.gz: a50513f654cb83bfaed158e5fe6a7a4e805804440946e86cb29529589635abf389bd7ff3bb924fc2244582b2c0e1d23bdc56651fbbe5649182dc37117e3aec2a
|
data/lib/jrpc.rb
CHANGED
data/lib/jrpc/tcp_client.rb
CHANGED
@@ -21,6 +21,8 @@ module JRPC
|
|
21
21
|
connect_timeout: t,
|
22
22
|
read_timeout: t, # write_timeout: t,
|
23
23
|
buffered: false # recommended for RPC
|
24
|
+
rescue ::SocketError
|
25
|
+
raise ConnectionError, "Can't connect to #{@uri}"
|
24
26
|
end
|
25
27
|
|
26
28
|
private
|
@@ -50,6 +52,8 @@ module JRPC
|
|
50
52
|
|
51
53
|
def send_request(request)
|
52
54
|
@transport.write Netstring.dump(request.to_s)
|
55
|
+
rescue ::SocketError
|
56
|
+
raise ConnectionError, "Can't send request to #{uri}"
|
53
57
|
end
|
54
58
|
|
55
59
|
def receive_response
|
@@ -57,6 +61,8 @@ module JRPC
|
|
57
61
|
response = @transport.read(length+1)
|
58
62
|
raise ClientError.new('invalid response. missed comma as terminator') if response[-1] != ','
|
59
63
|
response.chomp(',')
|
64
|
+
rescue ::SocketError
|
65
|
+
raise ConnectionError, "Can't receive response from #{uri}"
|
60
66
|
end
|
61
67
|
|
62
68
|
def get_msg_length
|
data/lib/jrpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netstring
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/jrpc.rb
|
119
119
|
- lib/jrpc/base_client.rb
|
120
120
|
- lib/jrpc/error/client_error.rb
|
121
|
+
- lib/jrpc/error/connection_error.rb
|
121
122
|
- lib/jrpc/error/error.rb
|
122
123
|
- lib/jrpc/error/internal_error.rb
|
123
124
|
- lib/jrpc/error/internal_server_error.rb
|