graphiti_errors 1.1.1 → 1.1.3
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/.github/workflows/release.yml +26 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/README.md +6 -0
- data/graphiti_errors.gemspec +1 -1
- 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
- data/lib/graphiti_errors.rb +8 -0
- metadata +11 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 456e67ca8513bd4c6774fb55dcba44e86c7127f1ee8e6f0e9705944f1660e0bb
|
|
4
|
+
data.tar.gz: 4a2fa464bf226e18887ccf4b3bd5004172f475e3519ff4e8afda5071cf513502
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37a154df91711d3f6ad3620675540da41000871003ff06d5a6ad53eaa9072eba0d231987a63d2f2f83d6f564e54cd0740346d5d9bca60ed8c6f91dd8499baf40
|
|
7
|
+
data.tar.gz: 6501252c791dfe0eb11a6dba991d34b7a9f446176152d8296cfc7c7e71809600ef1c04dc2d0f6143ba4e8f0c20718f378554c6476b1e558e970d030bce233e80
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Release
|
|
3
|
+
|
|
4
|
+
# Manual only. This gem is retired, so releases are rare and deliberate.
|
|
5
|
+
# gem push refuses a version that already exists, so bump lib/graphiti_errors/
|
|
6
|
+
# version.rb first.
|
|
7
|
+
on:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
name: Build and push
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: "3.1"
|
|
20
|
+
|
|
21
|
+
- name: Build and push
|
|
22
|
+
env:
|
|
23
|
+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
|
|
24
|
+
run: |
|
|
25
|
+
gem build graphiti_errors.gemspec
|
|
26
|
+
gem push graphiti_errors-*.gem
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.5.
|
|
1
|
+
2.5.1
|
data/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Graphiti Errors
|
|
2
2
|
|
|
3
|
+
> ### This gem is retired
|
|
4
|
+
>
|
|
5
|
+
> `graphiti_errors` is part of [graphiti](https://github.com/graphiti-api/graphiti) itself as of graphiti 2.0, and is no longer developed here. Issues and pull requests live in the [graphiti repo](https://github.com/graphiti-api/graphiti/issues).
|
|
6
|
+
>
|
|
7
|
+
> To upgrade from Graphiti 1.x to 2.x, follow the [upgrade guide](https://graphiti.dev/upgrading).
|
|
8
|
+
|
|
3
9
|

|
|
4
10
|
|
|
5
11
|
Error handling patterns for Graphiti.
|
data/graphiti_errors.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ["Lee Richmond"]
|
|
9
9
|
spec.email = ["lrichmond1@bloomberg.net"]
|
|
10
10
|
|
|
11
|
-
spec.summary = "
|
|
11
|
+
spec.summary = "Deprecated - part of graphiti itself as of graphiti 2.0"
|
|
12
12
|
spec.description = "Handles application errors and model validations"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
@@ -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: {
|
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!
|
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.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lee Richmond
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-08-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jsonapi-serializable
|
|
@@ -115,6 +115,7 @@ executables: []
|
|
|
115
115
|
extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
|
117
117
|
files:
|
|
118
|
+
- ".github/workflows/release.yml"
|
|
118
119
|
- ".gitignore"
|
|
119
120
|
- ".rspec"
|
|
120
121
|
- ".ruby-version"
|
|
@@ -134,16 +135,18 @@ files:
|
|
|
134
135
|
- gemfiles/rails_6.gemfile
|
|
135
136
|
- graphiti_errors.gemspec
|
|
136
137
|
- lib/graphiti_errors.rb
|
|
138
|
+
- lib/graphiti_errors/conflict_request/exception_handler.rb
|
|
139
|
+
- lib/graphiti_errors/conflict_request/serializer.rb
|
|
137
140
|
- lib/graphiti_errors/exception_handler.rb
|
|
138
141
|
- lib/graphiti_errors/invalid_request/exception_handler.rb
|
|
139
142
|
- lib/graphiti_errors/invalid_request/serializer.rb
|
|
140
143
|
- lib/graphiti_errors/validation/serializer.rb
|
|
141
144
|
- lib/graphiti_errors/version.rb
|
|
142
|
-
homepage:
|
|
145
|
+
homepage:
|
|
143
146
|
licenses:
|
|
144
147
|
- MIT
|
|
145
148
|
metadata: {}
|
|
146
|
-
post_install_message:
|
|
149
|
+
post_install_message:
|
|
147
150
|
rdoc_options: []
|
|
148
151
|
require_paths:
|
|
149
152
|
- lib
|
|
@@ -158,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
161
|
- !ruby/object:Gem::Version
|
|
159
162
|
version: '0'
|
|
160
163
|
requirements: []
|
|
161
|
-
rubygems_version: 3.
|
|
162
|
-
signing_key:
|
|
164
|
+
rubygems_version: 3.3.27
|
|
165
|
+
signing_key:
|
|
163
166
|
specification_version: 4
|
|
164
|
-
summary:
|
|
167
|
+
summary: Deprecated - part of graphiti itself as of graphiti 2.0
|
|
165
168
|
test_files: []
|