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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c439d87d996ad5e3f751dcc69346a7cc9bbb827db0fc884dd6a75ff0e8205561
4
- data.tar.gz: 0cbb4e08957b9f7ef05e03b1caf6737429d44b2a3b8edba7500777def0d49047
3
+ metadata.gz: 456e67ca8513bd4c6774fb55dcba44e86c7127f1ee8e6f0e9705944f1660e0bb
4
+ data.tar.gz: 4a2fa464bf226e18887ccf4b3bd5004172f475e3519ff4e8afda5071cf513502
5
5
  SHA512:
6
- metadata.gz: f32980eba6b37677bb3a7c064d3ae7723900ce5e992745423d06f22d7a7bb471be6a0285294e2a8eaf2d3b60c19596f0ac5a96a69e9274d2db6fc530fb8daea3
7
- data.tar.gz: 38dba2c032bee466ab80da61b32fd105b734a6d91d0b12aeb1c9040286e3325c423dbae1d3744b10bf023a9590696a680838d5af631babf176e63b1ada2c9d0e
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
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *~
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.2
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
  ![Build Status](https://travis-ci.org/graphiti-api/graphiti_errors.svg?branch=master)
4
10
 
5
11
  Error handling patterns for Graphiti.
@@ -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 = "Error-handling patterns for JSONAPIs"
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
 
@@ -0,0 +1,9 @@
1
+ module GraphitiErrors
2
+ module ConflictRequest
3
+ class ExceptionHandler < GraphitiErrors::InvalidRequest::ExceptionHandler
4
+ def status_code(error)
5
+ 409
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module GraphitiErrors
2
+ module ConflictRequest
3
+ class Serializer < InvalidRequest::Serializer
4
+ def initialize(errors)
5
+ super(errors)
6
+ @status_code = 409
7
+ end
8
+ end
9
+ end
10
+ end
@@ -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: "400",
19
+ status: @status_code.to_s,
19
20
  title: "Request Error",
20
21
  detail: errors.full_message(attribute, message),
21
22
  source: {
@@ -1,3 +1,3 @@
1
1
  module GraphitiErrors
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.3"
3
3
  end
@@ -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.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: 2019-10-09 00:00:00.000000000 Z
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.0.6
162
- signing_key:
164
+ rubygems_version: 3.3.27
165
+ signing_key:
163
166
  specification_version: 4
164
- summary: Error-handling patterns for JSONAPIs
167
+ summary: Deprecated - part of graphiti itself as of graphiti 2.0
165
168
  test_files: []