glia-errors 0.13.0 → 0.14.1
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/Gemfile +1 -1
- data/Gemfile.lock +27 -26
- data/README.md +1 -1
- data/catalog-info.yaml +16 -0
- data/glia-errors.gemspec +1 -1
- data/lib/glia/errors/client_errors.rb +14 -0
- data/lib/glia/errors/error_types.rb +1 -0
- data/lib/glia/errors.rb +1 -1
- metadata +4 -4
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed191a541738bdb411e948565ed5a52047b4e091137843353306212965ac13c0
|
|
4
|
+
data.tar.gz: 00e89550af7bd420ccd503031790d39a40fec53a30004213f1d8dea05c731c50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c829ab7ae9521732d506c329998cb361ea75e33228b9ed75a235056fb2e0e3b9784cfaae5db83b2bf5582799ef45e878735985b26e8faa59d299f02c6053744
|
|
7
|
+
data.tar.gz: e873b734312305383851a5c24d171fb1a7082d4c644ffb60c9c03ec7bf5a501f1b14705e01263254ff222cffa785428394859a5485741a440ed9af255cc09ede
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
glia-errors (0.
|
|
4
|
+
glia-errors (0.14.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
@@ -10,38 +10,38 @@ GEM
|
|
|
10
10
|
attr_extras (6.2.5)
|
|
11
11
|
concurrent-ruby (1.1.10)
|
|
12
12
|
diff-lcs (1.5.0)
|
|
13
|
-
dry-configurable (0.
|
|
13
|
+
dry-configurable (1.0.1)
|
|
14
|
+
dry-core (~> 1.0, < 2)
|
|
15
|
+
zeitwerk (~> 2.6)
|
|
16
|
+
dry-core (1.0.0)
|
|
14
17
|
concurrent-ruby (~> 1.0)
|
|
15
|
-
|
|
16
|
-
dry-
|
|
17
|
-
concurrent-ruby (~> 1.0)
|
|
18
|
-
dry-configurable (~> 0.13, >= 0.13.0)
|
|
19
|
-
dry-core (0.7.1)
|
|
20
|
-
concurrent-ruby (~> 1.0)
|
|
21
|
-
dry-inflector (0.2.1)
|
|
18
|
+
zeitwerk (~> 2.6)
|
|
19
|
+
dry-inflector (1.0.0)
|
|
22
20
|
dry-initializer (3.1.1)
|
|
23
|
-
dry-logic (1.
|
|
21
|
+
dry-logic (1.5.0)
|
|
24
22
|
concurrent-ruby (~> 1.0)
|
|
25
|
-
dry-core (~> 0
|
|
26
|
-
|
|
23
|
+
dry-core (~> 1.0, < 2)
|
|
24
|
+
zeitwerk (~> 2.6)
|
|
25
|
+
dry-schema (1.13.0)
|
|
27
26
|
concurrent-ruby (~> 1.0)
|
|
28
|
-
dry-configurable (~> 0
|
|
29
|
-
dry-core (~> 0
|
|
27
|
+
dry-configurable (~> 1.0, >= 1.0.1)
|
|
28
|
+
dry-core (~> 1.0, < 2)
|
|
30
29
|
dry-initializer (~> 3.0)
|
|
31
|
-
dry-logic (
|
|
32
|
-
dry-types (
|
|
33
|
-
|
|
30
|
+
dry-logic (>= 1.5, < 2)
|
|
31
|
+
dry-types (>= 1.7, < 2)
|
|
32
|
+
zeitwerk (~> 2.6)
|
|
33
|
+
dry-types (1.7.0)
|
|
34
34
|
concurrent-ruby (~> 1.0)
|
|
35
|
-
dry-
|
|
36
|
-
dry-
|
|
37
|
-
dry-
|
|
38
|
-
|
|
39
|
-
dry-validation (1.
|
|
35
|
+
dry-core (~> 1.0, < 2)
|
|
36
|
+
dry-inflector (~> 1.0, < 2)
|
|
37
|
+
dry-logic (>= 1.4, < 2)
|
|
38
|
+
zeitwerk (~> 2.6)
|
|
39
|
+
dry-validation (1.10.0)
|
|
40
40
|
concurrent-ruby (~> 1.0)
|
|
41
|
-
dry-
|
|
42
|
-
dry-core (~> 0.5, >= 0.5)
|
|
41
|
+
dry-core (~> 1.0, < 2)
|
|
43
42
|
dry-initializer (~> 3.0)
|
|
44
|
-
dry-schema (
|
|
43
|
+
dry-schema (>= 1.12, < 2)
|
|
44
|
+
zeitwerk (~> 2.6)
|
|
45
45
|
optimist (3.0.1)
|
|
46
46
|
parallel (1.22.1)
|
|
47
47
|
parser (3.1.1.0)
|
|
@@ -87,13 +87,14 @@ GEM
|
|
|
87
87
|
diff-lcs
|
|
88
88
|
patience_diff
|
|
89
89
|
unicode-display_width (2.1.0)
|
|
90
|
+
zeitwerk (2.6.6)
|
|
90
91
|
|
|
91
92
|
PLATFORMS
|
|
92
93
|
ruby
|
|
93
94
|
x86_64-darwin-19
|
|
94
95
|
|
|
95
96
|
DEPENDENCIES
|
|
96
|
-
dry-validation (~> 1.
|
|
97
|
+
dry-validation (~> 1.10)
|
|
97
98
|
glia-errors!
|
|
98
99
|
prettier (~> 0.22)
|
|
99
100
|
rake (~> 13.0)
|
data/README.md
CHANGED
data/catalog-info.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: backstage.io/v1alpha1
|
|
3
|
+
kind: Component
|
|
4
|
+
metadata:
|
|
5
|
+
name: glia-errors-ruby
|
|
6
|
+
description: Implements Glia errors in Ruby and provides utilities to easily construct them.
|
|
7
|
+
annotations:
|
|
8
|
+
github.com/project-slug: salemove/glia-errors
|
|
9
|
+
github.com/team-slug: salemove/tm-movers
|
|
10
|
+
snyk.io/org-name: glia-movers
|
|
11
|
+
tags:
|
|
12
|
+
- ruby
|
|
13
|
+
spec:
|
|
14
|
+
type: library
|
|
15
|
+
lifecycle: production
|
|
16
|
+
owner: tm-messenger
|
data/glia-errors.gemspec
CHANGED
|
@@ -207,6 +207,20 @@ module Glia
|
|
|
207
207
|
end
|
|
208
208
|
end
|
|
209
209
|
|
|
210
|
+
class ResourceLockedError < Error
|
|
211
|
+
def initialize(resource:, locked_by: nil, message: nil)
|
|
212
|
+
Naming.assert_snake_case(resource)
|
|
213
|
+
|
|
214
|
+
is_locked_by = locked_by.nil? ? '' : "Locked by: #{locked_by}"
|
|
215
|
+
super(
|
|
216
|
+
type: RESOURCE_LOCKED,
|
|
217
|
+
ref: create_ref(RESOURCE_LOCKED),
|
|
218
|
+
message: message || "#{Naming.humanize(resource)} is locked. #{is_locked_by}",
|
|
219
|
+
error_details: { resource: resource, locked_by: locked_by }
|
|
220
|
+
)
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
210
224
|
class ResourceAlreadyExistsError < Error
|
|
211
225
|
def initialize(resource:, message: nil)
|
|
212
226
|
Naming.assert_snake_case(resource)
|
|
@@ -16,6 +16,7 @@ module Glia
|
|
|
16
16
|
REMAINING_ASSOCIATION_ERROR = 'remaining_association_error'
|
|
17
17
|
RESOURCE_LIMIT_EXCEEDED_ERROR = 'resource_limit_exceeded_error'
|
|
18
18
|
RESOURCE_MINIMUM_NOT_REACHED = 'resource_minimum_not_reached'
|
|
19
|
+
RESOURCE_LOCKED = 'resource_locked'
|
|
19
20
|
RESOURCE_ALREADY_EXISTS_ERROR = 'resource_already_exists_error'
|
|
20
21
|
INVALID_RESOURCE_STATE_ERROR = 'invalid_resource_state_error'
|
|
21
22
|
AUTHORIZATION_ERROR = 'authorization_error'
|
data/lib/glia/errors.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Glia
|
|
|
14
14
|
|
|
15
15
|
# When updating supported version ensure that if new version contains new dry-validation new validations
|
|
16
16
|
# that they are correctly mapped to Glia errors in mapper.rb
|
|
17
|
-
unless dry_validation_version >= Gem::Version.new('1.0') && dry_validation_version < Gem::Version.new('1.
|
|
17
|
+
unless dry_validation_version >= Gem::Version.new('1.0') && dry_validation_version < Gem::Version.new('1.11')
|
|
18
18
|
raise 'Unsupported dry-validation version'
|
|
19
19
|
end
|
|
20
20
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glia-errors
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Glia TechMovers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: ''
|
|
14
14
|
email:
|
|
@@ -23,11 +23,11 @@ files:
|
|
|
23
23
|
- ".rspec"
|
|
24
24
|
- ".rubocop.yml"
|
|
25
25
|
- ".ruby-version"
|
|
26
|
-
- ".travis.yml"
|
|
27
26
|
- Gemfile
|
|
28
27
|
- Gemfile.lock
|
|
29
28
|
- README.md
|
|
30
29
|
- Rakefile
|
|
30
|
+
- catalog-info.yaml
|
|
31
31
|
- glia-errors.gemspec
|
|
32
32
|
- lib/glia/errors.rb
|
|
33
33
|
- lib/glia/errors/client_errors.rb
|
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '0'
|
|
60
60
|
requirements: []
|
|
61
|
-
rubygems_version: 3.
|
|
61
|
+
rubygems_version: 3.3.5
|
|
62
62
|
signing_key:
|
|
63
63
|
specification_version: 4
|
|
64
64
|
summary: Glia REST API errors
|
data/.travis.yml
DELETED