glia-errors 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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
- metadata +3 -3
- 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/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'
|
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.14.
|
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: 2023-
|
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
|
data/.travis.yml
DELETED