graphiti_errors 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/lib/graphiti_errors.rb +8 -0
- data/lib/graphiti_errors/conflict_request/exception_handler.rb +9 -0
- data/lib/graphiti_errors/conflict_request/serializer.rb +10 -0
- data/lib/graphiti_errors/invalid_request/serializer.rb +2 -1
- data/lib/graphiti_errors/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eac14bef8a9004d3ab1e5eeba886f693e7092b78a950a0cff8c9edf25b4a69c
|
4
|
+
data.tar.gz: 84dd7746013d13fe43a03745e105e5a5f845189823b6e5c0258a2b6e88c98fb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d23076704344134711bc9eb048ff7d73a1990ae89d46c7004b0b32539d35b30ac5a086d3713a1879246941d347ee3e6e01b0ead57ab599f8463439a5b39d959c
|
7
|
+
data.tar.gz: 98c33a10046cfdd481ae3c6ec7191e914c66f7d228d4b86943ceaaf4acdc71b7d7b969e95304dbe9d00866bdd9b8319892017898986e852ff69c82001cd606bc
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.1
|
data/lib/graphiti_errors.rb
CHANGED
@@ -4,6 +4,8 @@ require "graphiti_errors/version"
|
|
4
4
|
require "graphiti_errors/exception_handler"
|
5
5
|
require "graphiti_errors/invalid_request/serializer"
|
6
6
|
require "graphiti_errors/invalid_request/exception_handler"
|
7
|
+
require "graphiti_errors/conflict_request/serializer"
|
8
|
+
require "graphiti_errors/conflict_request/exception_handler"
|
7
9
|
require "graphiti_errors/validation/serializer"
|
8
10
|
|
9
11
|
module GraphitiErrors
|
@@ -14,6 +16,7 @@ module GraphitiErrors
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def self.inherited(subklass)
|
19
|
+
super
|
17
20
|
subklass._errorable_registry = _errorable_registry.dup
|
18
21
|
end
|
19
22
|
end
|
@@ -24,6 +27,11 @@ module GraphitiErrors
|
|
24
27
|
klass.register_exception Graphiti::Errors::InvalidRequest,
|
25
28
|
handler: GraphitiErrors::InvalidRequest::ExceptionHandler
|
26
29
|
end
|
30
|
+
|
31
|
+
if defined?(Graphiti::Errors::ConflictRequest)
|
32
|
+
klass.register_exception Graphiti::Errors::ConflictRequest,
|
33
|
+
handler: GraphitiErrors::ConflictRequest::ExceptionHandler
|
34
|
+
end
|
27
35
|
end
|
28
36
|
|
29
37
|
def self.disable!
|
@@ -4,6 +4,7 @@ module GraphitiErrors
|
|
4
4
|
attr_reader :errors
|
5
5
|
def initialize(errors)
|
6
6
|
@errors = errors
|
7
|
+
@status_code = 400
|
7
8
|
end
|
8
9
|
|
9
10
|
def rendered_errors
|
@@ -15,7 +16,7 @@ module GraphitiErrors
|
|
15
16
|
|
16
17
|
errors_payload << {
|
17
18
|
code: "bad_request",
|
18
|
-
status:
|
19
|
+
status: @status_code.to_s,
|
19
20
|
title: "Request Error",
|
20
21
|
detail: errors.full_message(attribute, message),
|
21
22
|
source: {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|
@@ -134,6 +134,8 @@ files:
|
|
134
134
|
- gemfiles/rails_6.gemfile
|
135
135
|
- graphiti_errors.gemspec
|
136
136
|
- lib/graphiti_errors.rb
|
137
|
+
- lib/graphiti_errors/conflict_request/exception_handler.rb
|
138
|
+
- lib/graphiti_errors/conflict_request/serializer.rb
|
137
139
|
- lib/graphiti_errors/exception_handler.rb
|
138
140
|
- lib/graphiti_errors/invalid_request/exception_handler.rb
|
139
141
|
- lib/graphiti_errors/invalid_request/serializer.rb
|
@@ -158,7 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
160
|
- !ruby/object:Gem::Version
|
159
161
|
version: '0'
|
160
162
|
requirements: []
|
161
|
-
|
163
|
+
rubyforge_project:
|
164
|
+
rubygems_version: 2.7.6
|
162
165
|
signing_key:
|
163
166
|
specification_version: 4
|
164
167
|
summary: Error-handling patterns for JSONAPIs
|