service_caller 0.1.5 → 1.0.1
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 -9
- 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: c5284539790a1d66ff79136adf0cec9cda146845e1f90b95537b44a7923824bf
|
4
|
+
data.tar.gz: ad3aeac59b19ca57e4822a299eb3c0d3c06b7100ea1e69172d8ab695c0e2668d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c84a748b42fa8d69ea32197ae170b5fc4f92f9f1c9ff8f08ef4597ab3f97213df2ea1917ff6b0ea596fe6c3e728aab346fee26379b59bbb53652029a994f40c
|
7
|
+
data.tar.gz: ad0a0fd20c82cde47ed87b95ee9b561ff0c13b06091f4ca3008d8304b9f370dfe48041f630f5faf26f033c44efc458cb9d1204ff852dd87c0c9cac318e92c18f
|
data/lib/service_error.rb
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
class ServiceError < StandardError
|
2
|
-
attr_reader :
|
2
|
+
attr_reader :key
|
3
3
|
|
4
4
|
class << self
|
5
5
|
def generate_from_exception(exception)
|
6
|
-
service_err = new(
|
6
|
+
service_err = new(:internal_error, "#{exception.class.name}: #{exception.message}")
|
7
7
|
service_err.set_backtrace(exception.backtrace)
|
8
8
|
service_err
|
9
9
|
end
|
10
|
-
|
11
|
-
def generate_from_hash(error_hash)
|
12
|
-
new(error_hash[:error_code], error_hash[:error_message])
|
13
|
-
end
|
14
10
|
end
|
15
11
|
|
16
|
-
def initialize(
|
17
|
-
@
|
18
|
-
super(message)
|
12
|
+
def initialize(key, message=nil)
|
13
|
+
@key = key
|
14
|
+
super(message || key)
|
19
15
|
end
|
20
16
|
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: 0.1
|
4
|
+
version: 1.0.1
|
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-08-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: basic implement of service object
|
14
14
|
email: laura34963@kdanmobile.com
|