service_caller 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/service_error.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31797557043d5fec9f9a5fa9497e0676742038ed7af367ffb5a0a9ab68bfd342
|
4
|
+
data.tar.gz: b3e2bf861756cc2c5bb5998801144366cc255cd6c3e564a91e6d8c218fc1305f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e426cec96768b798867683ddbc5962c0b361113574daaf7ec83c4e43f0fbb7358cdffb4dcea5a1440da9ae40e521610d6acfa58966ae3c07d52e5fe8846a0ee
|
7
|
+
data.tar.gz: 92faf376fac110cb0bf16b1e6ada0550690f35f038108f1704d18d6376e706828808280d17b0d1bc0e3974aebefa971a5652499f473d2915b78b7a50673e0fbd
|
data/lib/service_error.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
class ServiceError < StandardError
|
2
2
|
attr_reader :key
|
3
|
+
attr_reader :error_obj
|
3
4
|
|
4
5
|
class << self
|
5
6
|
def generate_from_exception(exception)
|
6
|
-
service_err = new(:internal_error, "#{exception.class.name}: #{exception.message}")
|
7
|
+
service_err = new(:internal_error, error_msg: "#{exception.class.name}: #{exception.message}")
|
7
8
|
service_err.set_backtrace(exception.backtrace)
|
8
9
|
service_err
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
|
-
def initialize(key,
|
13
|
+
def initialize(key, error_obj={})
|
13
14
|
@key = key
|
14
|
-
|
15
|
+
@error_obj = error_obj
|
16
|
+
super(error_obj[:error_msg] || key)
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_caller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JiaRou Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: basic implement of service object
|
14
14
|
email: laura34963@kdanmobile.com
|