service_caller 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/service_extend/handler.rb +22 -5
  3. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a3544c854586c6fd8006a80c8bc29d051fdabaf6174c794d1b10b8aca0a3daa
4
- data.tar.gz: b48b3c431120617656df73f9a92902f72e998028f89173121bfb065e503bd6b8
3
+ metadata.gz: 6afa477dd94592e09fc200d8168ffdb2c0217f4aa05b9b3082674d007bc44fab
4
+ data.tar.gz: e4e80bb81839255a0b976e6888aaf322d77615ae742c627df932540c57b9e9ac
5
5
  SHA512:
6
- metadata.gz: e38897abd533722e15132594974711a51674c9628793bfb0ae9b43f8ed2bb77f03b9f20e54ea89ac2dddf11652351817810f2f377f0c08074edcb6a9687b5fed
7
- data.tar.gz: 398f0f0b26c2e70083ad9caf9b98c11a339286f830088855ea73b880c193b663309feeccc4435cf4d5267fa88b6599cdf3e46900da2b46deb633245052dea65d
6
+ metadata.gz: 2cc1cb1018e4e0760373b042b726edcd857aea0af38e2054551a321f8ea759e6c2cafc7fbaa26974ae2486fbdf7c17df048fd258cfcd0b34e005713f7552e4f1
7
+ data.tar.gz: db4b7f8aac96d0f3b6e0517fbb3f62c1d122de6c62dfb5eb3c4549843e6601393ee2e253dc92b2013f67c49c05193bbb6e9d207b32177eee5e3b291dd4cc5172
@@ -1,11 +1,28 @@
1
1
  module ServiceExtend
2
2
  module Handler
3
+
3
4
  def call
4
- super
5
- rescue ServiceError => e
6
- @error = e
7
- rescue Exception => e
8
- @error = ServiceError.generate_from_exception(e)
5
+ if defined?(::Rails::Engine)
6
+ begin
7
+ super
8
+ rescue ServiceError => e
9
+ @error = e
10
+ rescue ActiveRecord::RecordNotFound => e
11
+ @error = ServiceError.new(404, e.message)
12
+ @error.set_backtrace(e.backtrace)
13
+ rescue Exception => e
14
+ @error = ServiceError.generate_from_exception(e)
15
+ end
16
+ else
17
+ begin
18
+ super
19
+ rescue ServiceError => e
20
+ @error = e
21
+ rescue Exception => e
22
+ @error = ServiceError.generate_from_exception(e)
23
+ end
24
+ end
9
25
  end
26
+
10
27
  end
11
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_caller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
@@ -42,8 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
- rubyforge_project:
46
- rubygems_version: 2.7.8
45
+ rubygems_version: 3.0.1
47
46
  signing_key:
48
47
  specification_version: 4
49
48
  summary: Ruby Service Basic Class