services_base 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/services/responses/error.rb +6 -4
- data/lib/services/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6466dc383fd69ea4358515c0c02519c761f0b0c5
|
4
|
+
data.tar.gz: 140dac3ef3780ce16827f4774069c106c4d5ec4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5573797b6ff2979df2bd38aad6bdba28d2d9fe08e4c3645c3b4e112f142db875fccd8aa198107166248b695079e318bbcbbaf8f5e377e85c48c8dc9262b78c9
|
7
|
+
data.tar.gz: 013c163885f9e488af104dda7fda884f9bf0e53e603d88272ca41e9280becaf78c93bb0fa08c7a0f1ceda1e0575c80f6eb34daec8d035bcae9dd0b4a48c61235
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Services
|
2
2
|
module Responses
|
3
3
|
class Error < Services::Responses::Base
|
4
|
-
attr_accessor :error_message, :error_code
|
4
|
+
attr_accessor :error_message, :error_code, :exception
|
5
5
|
|
6
|
-
def initialize(result, error_message: nil, error_code: nil, raise_exception_on_async_error: nil)
|
7
|
-
@result, @error_message, @error_code, @raise_exception_on_async_error =
|
8
|
-
result, error_message, error_code, raise_exception_on_async_error
|
6
|
+
def initialize(result, error_message: nil, error_code: nil, exception: nil, raise_exception_on_async_error: nil)
|
7
|
+
@result, @error_message, @error_code, @exception, @raise_exception_on_async_error =
|
8
|
+
result, error_message, error_code, exception, raise_exception_on_async_error
|
9
9
|
|
10
10
|
raise_if_async!
|
11
11
|
end
|
@@ -20,6 +20,8 @@ module Services
|
|
20
20
|
|
21
21
|
if @result.is_a?(Exception)
|
22
22
|
raise @result
|
23
|
+
elsif @exception
|
24
|
+
raise @exception
|
23
25
|
else
|
24
26
|
err = ("#{@error_message} " + "[#{@error_code}]".gsub("[]", "")).strip
|
25
27
|
raise StandardError.new(err)
|
data/lib/services/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: services_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Mercier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.6.
|
129
|
+
rubygems_version: 2.6.11
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Simple skeleton for implementing consistent Service Objects and Micro-Services
|