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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6f94f88be64fbb858c3777b2643212c42b71531ecf29ca13d770aa956fa5305
4
- data.tar.gz: 3aed8171baf58a42f0d376ac39c9c6c31fc4b4f2bf2ae957199b6935c1c93b01
3
+ metadata.gz: ced85209200ee1300de00d6ed66ed974c4367ed8fd9590f928e72af1beec7bf2
4
+ data.tar.gz: 9237654c617b83da0086c7c23177a3643bb879d3930eb12a27a0687b9bf3b950
5
5
  SHA512:
6
- metadata.gz: 6b0f0b4f4f56528361cc45c224fe1942cd041e7dbf5ec542f6a1f7329849d9e1be57596cd5eb91a7078205f57c2b9df8214c32500ffb52c70d49f5c5be5f77bc
7
- data.tar.gz: 7213d8c2fe73089fa633c38032f34c227db09e55c7f007158550b511533a267d4d621a75bff37b625578d9d877faceedc03f14542681c5744eac34bb70d26d2e
6
+ metadata.gz: 736c7c05eae6fee9f3577b929640ebc5edd53e6b38792de692dd9bbd85addec9968b3d92953f11721d804fa3ab1d3e36ff77cf99c333da55aaac8082e5c58341
7
+ data.tar.gz: 1d3ee769bcf962f31b3056079db996e3d8f71289ca20e7b0cd623f8a8117897c884b1d50bbe1ae7b85056f81013dcba0be8df600c5ffbb3c2e2dc88dd1481dd3
data/.circleci/config.yml CHANGED
@@ -7,7 +7,7 @@ jobs:
7
7
  build:
8
8
  docker:
9
9
  # specify the version you desire here
10
- - image: circleci/ruby:2.4.1
10
+ - image: circleci/ruby:2.6.3
11
11
 
12
12
  # Specify service dependencies here if necessary
13
13
  # CircleCI maintains a library of pre-built images
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsonapi_errors_handler (0.1.3)
4
+ jsonapi_errors_handler (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -26,10 +26,12 @@ module JsonapiErrorsHandler
26
26
  end
27
27
 
28
28
  def map_error(error)
29
- error_klass = error.class.name
30
- return nil unless ErrorMapper.mapped_error?(error_klass)
29
+ error_klass = error.is_a?(Class) ? error : error.class
31
30
 
32
- Object.const_get(ErrorMapper.mapped_errors[error_klass]).new
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonapiErrorsHandler
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
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
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-07-19 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler