json_apiable 0.5.1 → 0.5.2

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: c0104de3e7f3d39c672c55ab53075ceb19a03dcd490937bc5414fff3b07bec96
4
- data.tar.gz: 419896ce99a9854037332594c09fdea3223236af9b260ad02f341d3b20fe8eb9
3
+ metadata.gz: 8badac374f5beeb1a450a13c9e15a9b51ecf3f7999a1584037df80234746365e
4
+ data.tar.gz: 9731a6810c7bde962dfd7ff5874f18366b6bb378a7a0e4358200249ef12f569b
5
5
  SHA512:
6
- metadata.gz: 1d893bd2165aacdc9535aef14a273905aa80c05955cb643dd829b414b0139df0fbb98eb4d8d5661f866c5521929256595b5afc3f4795ff9e0ea7a5d85bc53e2b
7
- data.tar.gz: 68edd4b6ee0138f8d08872204e147de134f7f1a9f4c0a0a8eaf6ca88a235c8b6fc81227c87273fa173f78be38b9e903e78074726ac591a155c3e1134bc6114ef
6
+ metadata.gz: e0a1e8c16896ba6bb97165654a6fa31d2565eb2ae03a9a1fb464ee44f62cbf73b9556fc1f68366b2b3a54665bcd2ad66e84c7947200efe345a3de185f3259a60
7
+ data.tar.gz: 31e1bc0ce9505acc7234cc6dc0f1866ee1f7aa99411acedac3bff8db8d74360fa256b6e3fa11c969f2c8b6bb68f352604b5419f6b4c980fbe727975de63d48d4
@@ -20,7 +20,7 @@ module JsonApiable
20
20
 
21
21
  rescue_from ArgumentError, with: :respond_to_bad_argument
22
22
  rescue_from ActionController::UnpermittedParameters, with: :respond_to_bad_argument
23
- rescue_from JSONAPI::Serializer::UnsupportedIncludeError, with: :respond_to_bad_argument
23
+ rescue_from JSONAPI::Serializer::UnsupportedIncludeError, with: :respond_to_exception_raised
24
24
  rescue_from MalformedRequestError, with: :respond_to_malformed_request
25
25
  rescue_from UnprocessableEntityError, with: :respond_to_unprocessable_entity
26
26
  rescue_from UnauthorizedError, with: :respond_to_unauthorized
@@ -32,6 +32,11 @@ module JsonApiable
32
32
  json_render_errors json: errors, status: :bad_request
33
33
  end
34
34
 
35
+ def respond_to_exception_raised(err_msg)
36
+ errors = [{ title: 'Invalid Argument', detail: err_msg.message }]
37
+ json_render_errors json: errors, status: :bad_request
38
+ end
39
+
35
40
  def respond_to_malformed_request(err_msg = nil)
36
41
  errors = [{ title: 'Malformed Request', detail: err_msg.to_s }]
37
42
  json_render_errors json: errors, status: :bad_request
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonApiable
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_apiable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Polischuk