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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0ccf1501a60361ff4746fe5e597a45bcd99f851
4
- data.tar.gz: c89233b63b68af9f60d2819fede2f631e7a225af
3
+ metadata.gz: 6466dc383fd69ea4358515c0c02519c761f0b0c5
4
+ data.tar.gz: 140dac3ef3780ce16827f4774069c106c4d5ec4d
5
5
  SHA512:
6
- metadata.gz: f84ea0cbb0088f1fc89a23a277d5f0237b96f142d45b39852a444dabd48a3d9ce4bad25f34f8ea0f208c20c898f917a30def7ea24e72fb704e08a2b2771a2da9
7
- data.tar.gz: 36112023f6dfd8f4ed2ebee787e10abf4b61b88ebc83a983fbbcada06b29982c37e62f7b6e411500f4c91f842bc5adbcaed2aee95b62ed5ca3738ce82ea91faf
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)
@@ -1,3 +1,3 @@
1
1
  module Services
2
- VERSION = "0.4.0"
2
+ VERSION = "1.0.0"
3
3
  end
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.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-01-29 00:00:00.000000000 Z
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.13
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