fastbeans 0.3.9 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastbeans/errors.rb +17 -0
- data/lib/fastbeans/response.rb +3 -1
- data/lib/fastbeans/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 352fefab7b00565d7bd0cf6ca138925911924880
|
4
|
+
data.tar.gz: 5c66a8f395881323142249c9f372b39093f44940
|
5
5
|
!binary "U0hBNTEy":
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d51013f2cc2bf8530a491d1501e7fb4904b037f706e8335e60aebb4cba4f20a1b6194cdfd71283e42c00770a1027960d738d91b386b9731d012b79d99f7ef4cc
|
7
|
+
data.tar.gz: c76cab29d559fc7592fad04ef845fdd9d9221feef7d00af8c07b5a18d52e757c5f4aa8c1131b8b6d7d52182a5c8f2c6d4cfee922b119296f6342be5c8e90321a
|
data/lib/fastbeans/errors.rb
CHANGED
@@ -2,6 +2,23 @@ module Fastbeans
|
|
2
2
|
|
3
3
|
class RPCException < StandardError
|
4
4
|
attr_accessor :orig_exc
|
5
|
+
|
6
|
+
def initialize(msg, backtrace=nil)
|
7
|
+
super(msg)
|
8
|
+
@backtrace = backtrace
|
9
|
+
end
|
10
|
+
|
11
|
+
def backtrace
|
12
|
+
if @backtrace
|
13
|
+
if @backtrace.is_a?(String)
|
14
|
+
@backtrace.split(/\n/).map(&:strip)
|
15
|
+
else
|
16
|
+
@backtrace
|
17
|
+
end
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
5
22
|
end
|
6
23
|
|
7
24
|
class RemoteCallFailed < Fastbeans::RPCException; end
|
data/lib/fastbeans/response.rb
CHANGED
@@ -32,7 +32,9 @@ module Fastbeans
|
|
32
32
|
|
33
33
|
def to_exception
|
34
34
|
name = camelize(underscore(@raw_response["fastbeans-error"]))
|
35
|
-
|
35
|
+
error = @raw_response["error-information"]
|
36
|
+
|
37
|
+
Fastbeans.exception(name).new("%s. Call: %s" % [error["message"], error["call"]], error["backtrace"])
|
36
38
|
end
|
37
39
|
|
38
40
|
def camelize(term, uppercase_first_letter = true)
|
data/lib/fastbeans/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastbeans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dima Sabanin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|