jsonapi_errors_handler 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +1 -1
- data/lib/jsonapi_errors_handler.rb +5 -3
- data/lib/jsonapi_errors_handler/version.rb +1 -1
- 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: ced85209200ee1300de00d6ed66ed974c4367ed8fd9590f928e72af1beec7bf2
|
4
|
+
data.tar.gz: 9237654c617b83da0086c7c23177a3643bb879d3930eb12a27a0687b9bf3b950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 736c7c05eae6fee9f3577b929640ebc5edd53e6b38792de692dd9bbd85addec9968b3d92953f11721d804fa3ab1d3e36ff77cf99c333da55aaac8082e5c58341
|
7
|
+
data.tar.gz: 1d3ee769bcf962f31b3056079db996e3d8f71289ca20e7b0cd623f8a8117897c884b1d50bbe1ae7b85056f81013dcba0be8df600c5ffbb3c2e2dc88dd1481dd3
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -26,10 +26,12 @@ module JsonapiErrorsHandler
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def map_error(error)
|
29
|
-
error_klass = error.class
|
30
|
-
return nil unless ErrorMapper.mapped_error?(error_klass)
|
29
|
+
error_klass = error.is_a?(Class) ? error : error.class
|
31
30
|
|
32
|
-
|
31
|
+
return nil unless ErrorMapper.mapped_error?(error_klass.to_s)
|
32
|
+
return error if error.instance_of?(error_klass)
|
33
|
+
|
34
|
+
Object.const_get(ErrorMapper.mapped_errors[error_klass.to_s]).new
|
33
35
|
end
|
34
36
|
|
35
37
|
def render_error(error)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_errors_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Wilgosz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|