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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e38d51ec88d05024e91725acf05ce2e85fd1e257a070c36c8501f1ba965798e9
4
- data.tar.gz: b31fb9070cf3cced20945fd7f3a1f8cae8debb56ddb3fef88e6d7b771bd24b02
3
+ metadata.gz: 9bb748ea87689c6701f4b41269a45d9bce89c1cb5cca5339e6402c75a70a29e5
4
+ data.tar.gz: a1a7b05215716bf73ac3bcbf81af04a51fa80894eb3f6528f0670a77a379aff9
5
5
  SHA512:
6
- metadata.gz: 6cf6b6c72130c43e9944c232f126e6b5599a71aa871b6ff988c206c7eac838a6ee1bb6a4820363c626fc8817e05ae10a89f8e86493f0a5d39e2d3fc499277c75
7
- data.tar.gz: c1610825ec3736e3e28ec0e3bf7123a92ba47ec082c41803a0208640a6982e16ce497771696d0e1c8d29c157dc63539f1c15d62d2006c094a83cf829a0db2e4a
6
+ metadata.gz: b5426c450133b1159f6ae22c17fa5c8ec19309707145051e38c12ffe201c9786a54eb5a526c70585c4dc1f765f1ec858bd555531274b5e9d02097ac64a235dc8
7
+ data.tar.gz: 208f24bd3dea9bce196242748f613d203717c0ee0076c1bf0bbf64c5d685b06c9838878ea9b88204d13f4acf4eaca4267a7f04754328c789a9d0e95b6eddedd0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nats-rpc (0.0.7)
4
+ nats-rpc (0.1.0)
5
5
  nats-pure
6
6
 
7
7
  GEM
@@ -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
@@ -0,0 +1,6 @@
1
+ module NATS
2
+ module RPC
3
+ class RemoteError < StandardError
4
+ end
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  module NATS
2
2
  module RPC
3
- VERSION = "0.0.7"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
data/lib/nats/rpc.rb CHANGED
@@ -5,6 +5,7 @@ require 'json'
5
5
  require_relative "rpc/version"
6
6
  require_relative "rpc/servant"
7
7
  require_relative "rpc/client"
8
+ require_relative "rpc/errors"
8
9
 
9
10
  module NATS
10
11
  module RPC
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.7
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