nats-rpc 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nats/rpc/client.rb +8 -0
- data/lib/nats/rpc/errors.rb +6 -0
- data/lib/nats/rpc/version.rb +1 -1
- data/lib/nats/rpc.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bb748ea87689c6701f4b41269a45d9bce89c1cb5cca5339e6402c75a70a29e5
|
4
|
+
data.tar.gz: a1a7b05215716bf73ac3bcbf81af04a51fa80894eb3f6528f0670a77a379aff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5426c450133b1159f6ae22c17fa5c8ec19309707145051e38c12ffe201c9786a54eb5a526c70585c4dc1f765f1ec858bd555531274b5e9d02097ac64a235dc8
|
7
|
+
data.tar.gz: 208f24bd3dea9bce196242748f613d203717c0ee0076c1bf0bbf64c5d685b06c9838878ea9b88204d13f4acf4eaca4267a7f04754328c789a9d0e95b6eddedd0
|
data/Gemfile.lock
CHANGED
data/lib/nats/rpc/client.rb
CHANGED
@@ -17,6 +17,14 @@ module NATS
|
|
17
17
|
data = JSON.parse(msg["data"])
|
18
18
|
payload = JSON.parse(data["payload"])
|
19
19
|
|
20
|
+
if data["status"] == "error"
|
21
|
+
case data["code"]
|
22
|
+
when 2.0
|
23
|
+
raise RemoteError, payload
|
24
|
+
else
|
25
|
+
raise "Error code: #{data["code"]}"
|
26
|
+
end
|
27
|
+
end
|
20
28
|
[data, payload]
|
21
29
|
end
|
22
30
|
end
|
data/lib/nats/rpc/version.rb
CHANGED
data/lib/nats/rpc.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nats-rpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- e2e/servant.rb
|
92
92
|
- lib/nats/rpc.rb
|
93
93
|
- lib/nats/rpc/client.rb
|
94
|
+
- lib/nats/rpc/errors.rb
|
94
95
|
- lib/nats/rpc/servant.rb
|
95
96
|
- lib/nats/rpc/version.rb
|
96
97
|
- nats-rpc.gemspec
|